File: HideShowTutorialGuide.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 (20 lines) | stat: -rw-r--r-- 653 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
// Shows and hides the tutorial guide if the [H] button is pressed.

global func PlayerControl(int plr, int ctrl, id spec_id, int x, int y, int strength, bool repeat, int status)
{
	if (ctrl != CON_TutorialGuide)
		return _inherited(plr, ctrl, spec_id, x, y, strength, repeat, status, ...);
	// Don't do anything if the player is a sequence.
	if (GetActiveSequence())	
		return;
	// Find the guide object for this player.
	var guide = FindObject(Find_ID(TutorialGuide), Find_Owner(plr));
	if (!guide)
		return;
	// If hidden, show the guide. If shown, hide the guide.
	if (guide->IsHidden())
		guide->ShowGuide();
	else
		guide->HideGuide();
	return;
}