tutorials: hide guide message while in a dialogue (#1593)

objectmenu
Maikel de Vries 2016-01-17 12:39:24 +01:00
parent d607824df2
commit 5881018cb4
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,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, ...);
}