forked from 0ad/0ad
Adding ESC key confirmation.
This was SVN commit r6219.
This commit is contained in:
parent
7af5e039a7
commit
cccc55ce97
@ -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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user