File: HideGuideOnDialogue.c

package info (click to toggle)
openclonk 8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 169,656 kB
  • sloc: cpp: 180,484; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 148; sh: 101; javascript: 34
file content (29 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Makes sure the guide message is hidden when starting a dialogue and shown again when closing.

#appendto Dialogue

public func Interact(object clonk)
{
	if (!dlg_interact || !dlg_name)
		return inherited(clonk, ...);
	var guide = FindObject(Find_ID(TutorialGuide), Find_Owner(clonk->GetOwner()));
	if (!guide)
		return inherited(clonk, ...);
	if (dlg_status == DLG_Status_Stop)
	{
		if (this.guide_was_shown)
		{
			this.guide_was_shown = false;
			guide->ShowGuide();				
		}
	}
	else if (dlg_status != DLG_Status_Remove && dlg_status != DLG_Status_Wait)
	{
		if (!guide->IsHidden())
		{
			this.guide_was_shown = true;
			guide->HideGuide();	
		}
	}
	return inherited(clonk, ...);
}