mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-25 10:12:09 +00: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:
Binary file not shown.
@@ -196,6 +196,20 @@
|
|||||||
/>
|
/>
|
||||||
</sprite>
|
</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"])
|
"exploreMap", "disableTreasures", "lockTeams"])
|
||||||
hideControl(ctrl, ctrl + "Text", notScenario);
|
hideControl(ctrl, ctrl + "Text", notScenario);
|
||||||
|
|
||||||
|
Engine.GetGUIObjectByName("civResetButton").hidden = !notScenario;
|
||||||
|
|
||||||
for (let i = 0; i < g_MaxPlayers; ++i)
|
for (let i = 0; i < g_MaxPlayers; ++i)
|
||||||
{
|
{
|
||||||
Engine.GetGUIObjectByName("playerBox["+i+"]").hidden = (i >= numPlayers);
|
Engine.GetGUIObjectByName("playerBox["+i+"]").hidden = (i >= numPlayers);
|
||||||
@@ -1816,6 +1818,14 @@ function showMoreOptions(show)
|
|||||||
Engine.GetGUIObjectByName("moreOptions").hidden = !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()
|
function toggleReady()
|
||||||
{
|
{
|
||||||
g_IsReady = !g_IsReady;
|
g_IsReady = !g_IsReady;
|
||||||
|
|||||||
@@ -65,6 +65,16 @@
|
|||||||
Engine.PushGuiPage("page_civinfo.xml");
|
Engine.PushGuiPage("page_civinfo.xml");
|
||||||
]]></action>
|
]]></action>
|
||||||
</object>
|
</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%">
|
<object name="playerTeamHeading" type="text" style="ModernLabelText" size="85%+5 0 100%-5 100%">
|
||||||
<translatableAttribute id="caption">Team</translatableAttribute>
|
<translatableAttribute id="caption">Team</translatableAttribute>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
Reference in New Issue
Block a user