1
0
forked from 0ad/0ad

Adding ESC key confirmation.

This was SVN commit r6219.
This commit is contained in:
freenity 2008-07-12 21:28:28 +00:00
parent 7af5e039a7
commit cccc55ce97
2 changed files with 26 additions and 1 deletions

View File

@ -17,6 +17,18 @@
<action on="Press"><![CDATA[
guiToggle (this.name);
]]></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. -->
<object name="snFlip"

View File

@ -362,4 +362,17 @@ function snRefresh()
}
}
// ====================================================================
// ====================================================================
function confirmLeave()
{
if (isGameRunning())
{
endSession("return");
}
else
{
exit();
}
}