mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-01 13:47:56 +00:00
Adding ESC key confirmation.
This was SVN commit r6219.
This commit is contained in:
@@ -17,6 +17,18 @@
|
|||||||
<action on="Press"><![CDATA[
|
<action on="Press"><![CDATA[
|
||||||
guiToggle (this.name);
|
guiToggle (this.name);
|
||||||
]]></action>
|
]]></action>
|
||||||
|
|
||||||
|
<!-- EMPTY OBJECT TO END THE SESSION BUT WITH A CONFIRMATION BOX. (ESC key) -->
|
||||||
|
<object name="snLeave"
|
||||||
|
hotkey="leave"
|
||||||
|
>
|
||||||
|
<action on="Press"><![CDATA[
|
||||||
|
btCaptions = new Array("Yes", "No!");
|
||||||
|
btCode = new Array("confirmLeave()", "");
|
||||||
|
messageBox (400, 200, "Do you really want to quit?", "Confirmation", 0, btCaptions, btCode);
|
||||||
|
]]></action>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
|
||||||
<!-- EMPTY OBJECT USED TO FLIP THE GUI TO VARIOUS ORIENTATIONS. -->
|
<!-- EMPTY OBJECT USED TO FLIP THE GUI TO VARIOUS ORIENTATIONS. -->
|
||||||
<object name="snFlip"
|
<object name="snFlip"
|
||||||
|
|||||||
@@ -362,4 +362,17 @@ function snRefresh()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
|
|
||||||
|
|
||||||
|
function confirmLeave()
|
||||||
|
{
|
||||||
|
if (isGameRunning())
|
||||||
|
{
|
||||||
|
endSession("return");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user