Fixes button order consistency in a few places: resign confirmation, manual, splashscreen, fixes #2837. NOTE: the convention is Cancel/Back button on the left, other action buttons are to the right. Please report any you find that don't match that!

Adds hotkey.cancel mapped to the Escape key, which is now used for
closing/canceling in-game dialogs, fixes #2636, #3200. Please report any
dialogs where Esc doesn't work!

This was SVN commit r16736.
This commit is contained in:
historic_bruno 2015-06-08 03:07:45 +00:00
parent 7cac7cd65e
commit a964e83c79
21 changed files with 40 additions and 34 deletions

View File

@ -136,8 +136,9 @@ skycolor = "0 0 0"
; > SYSTEM SETTINGS
exit = "Alt+F4", "Ctrl+Break", "Super+Q" ; Exit to desktop
cancel = Escape ; Close or cancel the current dialog box/popup
leave = Escape ; End current game or Exit
confirm = Return ; Confirm the current command.
confirm = Return ; Confirm the current command
pause = Pause ; Pause/unpause game
screenshot = F2 ; Take PNG screenshot
bigscreenshot = "Shift+F2" ; Take large BMP screenshot

View File

@ -174,7 +174,7 @@
<action on="Press">Engine.Exit();</action>
</object>
<object type="button" style="ModernButtonRed" size="100%-576 100%-44 100%-392 100%-16">
<object type="button" style="ModernButtonRed" size="100%-576 100%-44 100%-392 100%-16" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closePage();</action>
</object>

View File

@ -32,7 +32,7 @@
<object name="aiDescription" type="text" style="ModernLabelText" size="8% 50%-54 92% 50%+74"/>
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17">
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">Engine.PopGuiPage();</action>
</object>

View File

@ -114,6 +114,7 @@
type="button"
style="StoneButton"
size="100%-164 100%-52 100%-24 100%-24"
hotkey="cancel"
>
<translatableAttribute id="caption">Close</translatableAttribute>
<action on="Press">

View File

@ -392,6 +392,7 @@
style="StoneButton"
size="50%-70 370 50%+70 396"
tooltip_style="onscreenToolTip"
hotkey="cancel"
>
<translatableAttribute id="caption">OK</translatableAttribute>
<translatableAttribute id="tooltip">Close more game options window</translatableAttribute>

View File

@ -100,7 +100,7 @@
<object name="hostFeedback" type="text" style="ModernLabelText" size="50 100%-90 100%-50 100%-50" textcolor="red" />
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17">
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">cancelSetup();</action>
</object>

View File

@ -260,7 +260,7 @@
displayProfile("leaderboard");
</action>
</object>
<object type="button" style="ModernButtonRed" size="50%-133 100%-45 50%-5 100%-17">
<object type="button" style="ModernButtonRed" size="50%-133 100%-45 50%-5 100%-17" hotkey="cancel">
<translatableAttribute id="caption">Back</translatableAttribute>
<action on="Press">
Engine.GetGUIObjectByName("leaderboard").hidden = true;
@ -322,7 +322,7 @@
</object>
</object>
</object>
<object type="button" style="ModernButtonRed" size="50%-64 100%-50 50%+64 100%-25">
<object type="button" style="ModernButtonRed" size="50%-64 100%-50 50%+64 100%-25" hotkey="cancel">
<translatableAttribute id="caption">Back</translatableAttribute>
<action on="Press">
Engine.GetGUIObjectByName("profileFetch").hidden = true;

View File

@ -93,7 +93,7 @@
</object>
<object name="feedback" type="text" size="50 100%-90 100%-50 100%-50" style="ModernLabelText" textcolor="red" text_align="center"/>
<object name="cancel" type="button" size="18 100%-45 50%-5 100%-17" style="ModernButtonRed">
<object name="cancel" type="button" size="18 100%-45 50%-5 100%-17" style="ModernButtonRed" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">
if (Engine.GetGUIObjectByName("pageWelcome").hidden)

View File

@ -32,7 +32,7 @@
</object>
<object name="localeText" type="text" size="40%+10 80 100% 105" textcolor="white" />
<object type="button" size="0 100%-60 33% 100%-32" style="ModernButtonRed">
<object type="button" size="0 100%-60 33% 100%-32" style="ModernButtonRed" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">cancelSetup();</action>
</object>

View File

@ -61,7 +61,7 @@
</object>
<object name="dictionaryFile" type="text" size="50%+10 260 100% 345" textcolor="white" />
<object type="button" size="0 100%-60 33% 100%-32" style="ModernButtonRed">
<object type="button" size="0 100%-60 33% 100%-32" style="ModernButtonRed" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">cancelSetup();</action>
</object>

View File

@ -16,13 +16,13 @@
<object name="mainText" type="text" style="textPanel"/>
</object>
<object name="url" type="button" style="ModernButtonRed" size="100%-308 100%-52 100%-168 100%-24" hidden="true">
<translatableAttribute id="caption">View Online</translatableAttribute>
</object>
<object type="button" style="ModernButtonRed" tooltip_style="snToolTip" size="100%-164 100%-52 100%-24 100%-24">
<object type="button" style="ModernButtonRed" tooltip_style="snToolTip" size="100%-308 100%-52 100%-168 100%-24" hotkey="cancel">
<translatableAttribute id="caption">Close</translatableAttribute>
<action on="Press"><![CDATA[closeManual();]]></action>
</object>
<object name="url" type="button" style="ModernButtonRed" size="100%-164 100%-52 100%-24 100%-24" hidden="true">
<translatableAttribute id="caption">View Online</translatableAttribute>
</object>
</object>
</objects>

View File

@ -8,9 +8,9 @@ function init(data)
var mbButton2Obj = Engine.GetGUIObjectByName("mbButton2");
var mbButton3Obj = Engine.GetGUIObjectByName("mbButton3");
var mbLeaveHotkey = Engine.GetGUIObjectByName("mbLeaveHotkey");
var mbCancelHotkey = Engine.GetGUIObjectByName("mbCancelHotkey");
// Default behaviour
mbLeaveHotkey.onPress = function()
mbCancelHotkey.onPress = function()
{
Engine.PopGuiPage();
};
@ -66,7 +66,7 @@ function init(data)
mbButton1Obj.onPress = action;
mbButton1Obj.hidden = false;
mbLeaveHotkey.onPress = action;
mbCancelHotkey.onPress = action;
}
if (data.buttonCaptions.length >= 2)
{
@ -81,8 +81,6 @@ function init(data)
mbButton2Obj.caption = data.buttonCaptions[1];
mbButton2Obj.onPress = action;
mbButton2Obj.hidden = false;
mbLeaveHotkey.onPress = action;
}
if (data.buttonCaptions.length >= 3)
{
@ -97,8 +95,6 @@ function init(data)
mbButton3Obj.caption = data.buttonCaptions[2];
mbButton3Obj.onPress = action;
mbButton3Obj.hidden = false;
mbLeaveHotkey.onPress = action;
}
switch (data.buttonCaptions.length)

View File

@ -6,7 +6,7 @@
<!-- Fade out the background because it's non-interactable -->
<object sprite="ModernFade" type="image" z="0"/>
<object name="mbLeaveHotkey" hotkey="leave" />
<object name="mbCancelHotkey" hotkey="cancel" />
<object name="mbMain"
style="ModernDialog"
type="image"

View File

@ -65,7 +65,7 @@
</object>
</repeat>
</object>
<object type="button" style="ModernButtonRed" size="320 100%-44 50%-4 100%-16">
<object type="button" style="ModernButtonRed" size="320 100%-44 50%-4 100%-16" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closePage();</action>
</object>

View File

@ -125,6 +125,12 @@
==========================================
-->
<object hotkey="cancel">
<action on="Press">
closeMenu();
</action>
</object>
<!-- hide submenu when user clicks on the background -->
<object name="subMenuScreen" type="button">
<action on="Press">

View File

@ -21,7 +21,7 @@
size="24 24 100%-24 100%-100">
</object>
<object type="button" size="0%+25 100%-60 33%+10 100%-32" style="StoneButton">
<object type="button" size="0%+25 100%-60 33%+10 100%-32" style="StoneButton" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">Engine.PopGuiPage();</action>
</object>

View File

@ -33,7 +33,7 @@
<action on="Press">saveGame();</action>
</object>
<object name="saveButton" type="button" size="0%+25 100%-60 33%+10 100%-32" style="StoneButton">
<object name="saveButton" type="button" size="0%+25 100%-60 33%+10 100%-32" style="StoneButton" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closeSave(true);</action>
</object>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object>
<object hotkey="leave">
<object hotkey="cancel">
<action on="Press">closeOpenDialogs();</action>
</object>

View File

@ -136,8 +136,8 @@ function resignMenuButton()
closeMenu();
closeOpenDialogs();
pauseGame();
var btCaptions = [translate("Yes"), translate("No")];
var btCode = [resignGame, resumeGame];
var btCaptions = [translate("No"), translate("Yes")];
var btCode = [resumeGame, resignGame];
messageBox(400, 200, translate("Are you sure you want to resign?"), translate("Confirmation"), 0, btCaptions, btCode);
}

View File

@ -18,7 +18,13 @@
</object>
<object name="displaySplashScreen" size="8 100%-30 22 100%-8" type="checkbox" style="ModernTickBox"/>
</object>
<object name="btnOK" type="button" style="ModernButtonRed" size="50%+5 100%-45 100%-18 100%-17">
<object type="button" style="ModernButtonRed" size="50%+5 100%-45 100%-18 100%-17">
<translatableAttribute id="caption">Known Issues (web)</translatableAttribute>
<action on="Press"><![CDATA[
openURL("http://www.wildfiregames.com/forum/index.php?showtopic=15796");
]]></action>
</object>
<object name="btnOK" type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17" hotkey="cancel">
<translatableAttribute id="caption">OK</translatableAttribute>
<action on="Press"><![CDATA[
if (Engine.GetGUIObjectByName("displaySplashScreen").checked)
@ -29,11 +35,5 @@
Engine.PopGuiPageCB();
]]></action>
</object>
<object type="button" style="ModernButtonRed" size="18 100%-45 50%-5 100%-17">
<translatableAttribute id="caption">Known Issues (web)</translatableAttribute>
<action on="Press"><![CDATA[
openURL("http://www.wildfiregames.com/forum/index.php?showtopic=15796");
]]></action>
</object>
</object>
</objects>

View File

@ -85,6 +85,7 @@
type="button"
style="StoneButton"
size="100%-164 100%-44 100%-16 100%-16"
hotkey="cancel"
>
<translatableAttribute id="caption">Close</translatableAttribute>
<action on="Press">closeStrucTree();</action>