Ticket #2373: resignation_v2.patch

File resignation_v2.patch, 5.1 KB (added by Michael, 10 years ago)

Exit is possible only after the game is over; reordered menu.

  • binaries/data/mods/public/gui/session/menu.js

     
    99const MARGIN = 4;
    1010
    1111// Includes the main menu button
    12 const NUM_BUTTONS = 8;
     12const NUM_BUTTONS = 7;
    1313
    1414// Regular menu buttons
    1515const BUTTON_HEIGHT = 32;
  • binaries/data/mods/public/gui/session/session.js

     
    411411        return;
    412412
    413413    // We can't resign once the game is over.
    414     Engine.GetGUIObjectByName("menuResignButton").enabled = false;
     414    Engine.GetGUIObjectByName("menuResignButton").hidden = true;
     415    Engine.GetGUIObjectByName("menuExitButton").hidden = false;
    415416
    416417    // Make sure nothing is open to avoid stacking.
    417418    closeMenu();
  • binaries/data/mods/public/gui/session/session.xml

     
    776776        z="40"
    777777    >
    778778        <object size="4 36 100%-4 50%+20">
     779       
     780            <!-- Manual button -->
     781            <object type="button"
     782                name="manualButton"
     783                style="StoneButtonFancy"
     784                size="0 0 100% 28"
     785                tooltip_style="sessionToolTip"
     786            >
     787                Manual
     788                <action on="Press">openManual();</action>
     789            </object>
     790           
     791            <!-- Chat button -->
     792            <object type="button"
     793                name="chatButton"
     794                style="StoneButtonFancy"
     795                size="0 32 100% 60"
     796                tooltip_style="sessionToolTip"
     797            >
     798                Chat
     799                <action on="Press">chatMenuButton();</action>
     800            </object>
    779801
    780         <!-- Settings button -->
    781         <object type="button"
    782             name="settingsButton"
    783             style="StoneButtonFancy"
    784             size="0 0 100% 28"
    785             tooltip_style="sessionToolTip"
    786         >
    787             Settings
    788             <action on="Press">settingsMenuButton();</action>
    789         </object>
     802            <!-- Save game button -->
     803            <object type="button"
     804                name="saveGameButton"
     805                style="StoneButtonFancy"
     806                size="0 64 100% 92"
     807                tooltip_style="sessionToolTip"
     808            >
     809                Save
     810                <action on="Press">
     811                openSave();
     812                </action>
     813            </object>
     814           
     815            <!-- Settings button -->
     816            <object type="button"
     817                name="settingsButton"
     818                style="StoneButtonFancy"
     819                size="0 96 100% 124"
     820                tooltip_style="sessionToolTip"
     821            >
     822                Settings
     823                <action on="Press">settingsMenuButton();</action>
     824            </object>
    790825
    791 
    792         <!-- Save game button -->
    793         <object type="button"
    794             name="saveGameButton"
    795             style="StoneButtonFancy"
    796             size="0 32 100% 60"
    797             tooltip_style="sessionToolTip"
    798         >
    799             Save
    800             <action on="Press">
    801             openSave();
    802             </action>
     826            <!-- Pause / Resume Button -->
     827            <object type="button"
     828                name="pauseButton"
     829                style="StoneButtonFancy"
     830                size="0 128 100% 156"
     831                tooltip_style="sessionToolTip"
     832            >
     833                <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
     834                <action on="Press">togglePause();</action>
     835            </object>
     836           
     837            <!-- Resign button -->
     838            <object type="button"
     839                name="menuResignButton"
     840                style="StoneButtonFancy"
     841                size="0 160 100% 188"
     842                tooltip_style="sessionToolTip"
     843            >
     844                Resign
     845                <action on="Press">resignMenuButton();</action>
     846            </object>
     847           
     848            <!-- Exit button -->
     849            <object type="button"
     850                name="menuExitButton"
     851                style="StoneButtonFancy"
     852                size="0 160 100% 188"
     853                tooltip_style="sessionToolTip"
     854                hidden="true"
     855            >
     856                Exit
     857                <action on="Press">exitMenuButton();</action>
     858            </object>
    803859        </object>
    804 
    805         <!-- Chat button -->
    806         <object type="button"
    807             name="chatButton"
    808             style="StoneButtonFancy"
    809             size="0 64 100% 92"
    810             tooltip_style="sessionToolTip"
    811         >
    812             Chat
    813             <action on="Press">chatMenuButton();</action>
    814         </object>
    815 
    816         <!-- Resign button -->
    817         <object type="button"
    818             name="menuResignButton"
    819             style="StoneButtonFancy"
    820             size="0 96 100% 124"
    821             tooltip_style="sessionToolTip"
    822         >
    823             Resign
    824             <action on="Press">resignMenuButton();</action>
    825         </object>
    826 
    827         <!-- Exit button -->
    828         <object type="button"
    829             name="menuExitButton"
    830             style="StoneButtonFancy"
    831             size="0 128 100% 156"
    832             tooltip_style="sessionToolTip"
    833         >
    834             Exit
    835             <action on="Press">exitMenuButton();</action>
    836         </object>
    837 
    838         <!-- Pause / Resume Button -->
    839         <object type="button"
    840             name="pauseButton"
    841             style="StoneButtonFancy"
    842             size="0 160 100% 188"
    843             tooltip_style="sessionToolTip"
    844         >
    845             <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
    846             <action on="Press">togglePause();</action>
    847         </object>
    848 
    849         <!-- Manual button -->
    850         <object type="button"
    851             name="manualButton"
    852             style="StoneButtonFancy"
    853             size="0 192 100% 220"
    854             tooltip_style="sessionToolTip"
    855         >
    856             Manual
    857             <action on="Press">openManual();</action>
    858         </object>
    859         </object>
    860860    </object>
    861861
    862862    <!-- In-progress research -->