Add a button to the gamesetup to reset the selected civilizations of all players to random.
Code by Sandarac, icon by Lionkanzen, fixes #3805. This was SVN commit r18239.
This commit is contained in:
parent
30e7b3bf25
commit
78accf3d97
BIN
binaries/data/mods/public/art/textures/ui/global/icon/reset.png
(Stored with Git LFS)
Normal file
BIN
binaries/data/mods/public/art/textures/ui/global/icon/reset.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -196,6 +196,20 @@
|
||||
/>
|
||||
</sprite>
|
||||
|
||||
<sprite name="iconResetGold">
|
||||
<effect add_color="237 227 167" />
|
||||
<image texture="global/icon/reset.png"
|
||||
size="0 3 100% 100%+3"
|
||||
/>
|
||||
</sprite>
|
||||
|
||||
<sprite name="iconResetWhite">
|
||||
<effect add_color="255 255 255" />
|
||||
<image texture="global/icon/reset.png"
|
||||
size="0 3 100% 100%+3"
|
||||
/>
|
||||
</sprite>
|
||||
|
||||
|
||||
<!--
|
||||
==========================================
|
||||
|
@ -1396,6 +1396,8 @@ function updateGUIObjects()
|
||||
"exploreMap", "disableTreasures", "lockTeams"])
|
||||
hideControl(ctrl, ctrl + "Text", notScenario);
|
||||
|
||||
Engine.GetGUIObjectByName("civResetButton").hidden = !notScenario;
|
||||
|
||||
for (let i = 0; i < g_MaxPlayers; ++i)
|
||||
{
|
||||
Engine.GetGUIObjectByName("playerBox["+i+"]").hidden = (i >= numPlayers);
|
||||
@ -1816,6 +1818,14 @@ function showMoreOptions(show)
|
||||
Engine.GetGUIObjectByName("moreOptions").hidden = !show;
|
||||
}
|
||||
|
||||
function resetCivilizations()
|
||||
{
|
||||
for (let i in g_GameAttributes.settings.PlayerData)
|
||||
g_GameAttributes.settings.PlayerData[i].Civ = "random";
|
||||
|
||||
updateGameAttributes();
|
||||
}
|
||||
|
||||
function toggleReady()
|
||||
{
|
||||
g_IsReady = !g_IsReady;
|
||||
|
@ -65,6 +65,16 @@
|
||||
Engine.PushGuiPage("page_civinfo.xml");
|
||||
]]></action>
|
||||
</object>
|
||||
<object name="civResetButton"
|
||||
type="button"
|
||||
sprite="iconResetGold"
|
||||
sprite_over="iconResetWhite"
|
||||
size="67.5%+93 0 67.5%+109 16"
|
||||
tooltip_style="onscreenToolTip"
|
||||
>
|
||||
<translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random)</translatableAttribute>
|
||||
<action on="Press">resetCivilizations();</action>
|
||||
</object>
|
||||
<object name="playerTeamHeading" type="text" style="ModernLabelText" size="85%+5 0 100%-5 100%">
|
||||
<translatableAttribute id="caption">Team</translatableAttribute>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user