mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
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
4 changed files with 37 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e7ed6ac3acc13141649e7a285a0512cae1b43139b0a864157720c26e8557eb43
|
||||
size 2979
|
||||
|
|
@ -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 a new issue