Ticket #3805: resetcivsbutton_v2.patch

File resetcivsbutton_v2.patch, 3.1 KB (added by Sandarac, 8 years ago)
  • art/textures/ui/global/icon/reset.png

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
  • gui/common/sprite1.xml

    Property changes on: art/textures/ui/global/icon/reset.png
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +application/octet-stream
    \ No newline at end of property
     
    195195            size="0 3 100% 100%+3"
    196196        />
    197197    </sprite>
     198   
     199    <sprite name="iconResetGold">
     200        <effect add_color="237 227 167" />
     201        <image  texture="global/icon/reset.png"
     202            size="0 3 100% 100%+3"
     203        />
     204    </sprite>
    198205
     206    <sprite name="iconResetWhite">
     207        <effect add_color="255 255 255" />
     208        <image  texture="global/icon/reset.png"
     209            size="0 3 100% 100%+3"
     210        />
     211    </sprite>
    199212
     213
    200214    <!--
    201215    ==========================================
    202216    SKIN - WHEAT
  • gui/gamesetup/gamesetup.js

     
    13781378        g_GameAttributes.settings.GameType != "wonder";
    13791379
    13801380    Engine.GetGUIObjectByName("cheatWarningText").hidden = !g_IsNetworked || !mapSettings.CheatsEnabled;
    1381 
     1381    Engine.GetGUIObjectByName("civResetButton").hidden = g_GameAttributes.mapType == "scenario" || !g_IsController;
    13821382    Engine.GetGUIObjectByName("enableCheats").enabled = !mapSettings.RatingEnabled;
    13831383    Engine.GetGUIObjectByName("lockTeams").enabled = !mapSettings.RatingEnabled;
    13841384
     
    18161816    Engine.GetGUIObjectByName("moreOptions").hidden = !show;
    18171817}
    18181818
     1819function resetCivilizations()
     1820{
     1821    for (let i in g_GameAttributes.settings.PlayerData)
     1822        g_GameAttributes.settings.PlayerData[i].Civ = "random";
     1823    updateGameAttributes()
     1824}
     1825
    18191826function toggleReady()
    18201827{
    18211828    g_IsReady = !g_IsReady;
  • gui/gamesetup/gamesetup.xml

     
    6565                            Engine.PushGuiPage("page_civinfo.xml");
    6666                        ]]></action>
    6767                    </object>
     68                    <object name="civResetButton"
     69                        type="button"
     70                        sprite="iconResetGold"
     71                        sprite_over="iconResetWhite"
     72                        size="67.5%+93 0 67.5%+109 16"
     73                        tooltip_style="onscreenToolTip"
     74                    >
     75                        <translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random)</translatableAttribute>
     76                        <action on="Press">resetCivilizations()</action>
     77                    </object>
    6878                    <object name="playerTeamHeading" type="text" style="ModernLabelText" size="85%+5 0 100%-5 100%">
    6979                        <translatableAttribute id="caption">Team</translatableAttribute>
    7080                    </object>