forked from Mirrors/openclonk
tutorials: hide guide message while in a dialogue (#1593)
parent
d607824df2
commit
5881018cb4
|
@ -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, ...);
|
||||
}
|
Loading…
Reference in New Issue