Ticket #3805: resetcivsbutton.patch
File resetcivsbutton.patch, 1.8 KB (added by , 8 years ago) |
---|
-
gamesetup.js
1381 1381 1382 1382 Engine.GetGUIObjectByName("enableCheats").enabled = !mapSettings.RatingEnabled; 1383 1383 Engine.GetGUIObjectByName("lockTeams").enabled = !mapSettings.RatingEnabled; 1384 Engine.GetGUIObjectByName("resetCivilizations").hidden = g_GameAttributes.mapType == "scenario" || !g_IsController; 1384 1385 1385 1386 // Mapsize completely hidden for non-random maps 1386 1387 let isRandom = g_GameAttributes.mapType == "random"; … … 1799 1800 Engine.GetGUIObjectByName("moreOptions").hidden = !show; 1800 1801 } 1801 1802 1803 function resetCivilizations() 1804 { 1805 for (let i in g_GameAttributes.settings.PlayerData) 1806 { 1807 g_GameAttributes.settings.PlayerData[i].Civ = "random"; 1808 } 1809 updateGUIObjects() 1810 } 1811 1802 1812 function toggleReady() 1803 1813 { 1804 1814 g_IsReady = !g_IsReady; -
gamesetup.xml
265 265 <translatableAttribute id="tooltip">See more game options</translatableAttribute> 266 266 <action on="Press">showMoreOptions(true);</action> 267 267 </object> 268 268 269 <!-- Reset Civilizations Button --> 270 <object 271 name="resetCivilizations" 272 type="button" 273 style="StoneButton" 274 size="69%-120 0 69% 28" 275 tooltip_style="onscreenToolTip" 276 > 277 <translatableAttribute id="caption">Reset Civilizations</translatableAttribute> 278 <translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random)</translatableAttribute> 279 <action on="Press">resetCivilizations();</action> 280 </object> 281 269 282 <!-- End Options --> 270 283 </object> 271 284