mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix GUI errors when a client joins a multiplayer game setup room.
Based on a patch by cwprogger, fixes #2779 This was SVN commit r15802.
This commit is contained in:
@@ -1033,10 +1033,17 @@ function onGameAttributesChange()
|
||||
var mapSelectionBox = Engine.GetGUIObjectByName("mapSelection");
|
||||
mapSelectionBox.selected = mapSelectionBox.list_data.indexOf(mapName);
|
||||
Engine.GetGUIObjectByName("mapSelectionText").caption = translate(getMapDisplayName(mapName));
|
||||
var populationCapBox = Engine.GetGUIObjectByName("populationCap");
|
||||
populationCapBox.selected = populationCapBox.list_data.indexOf(mapSettings.PopulationCap);
|
||||
var startingResourcesBox = Engine.GetGUIObjectByName("startingResources");
|
||||
startingResourcesBox.selected = startingResourcesBox.list_data.indexOf(mapSettings.StartingResources);
|
||||
if (mapSettings.PopulationCap)
|
||||
{
|
||||
var populationCapBox = Engine.GetGUIObjectByName("populationCap");
|
||||
populationCapBox.selected = populationCapBox.list_data.indexOf(mapSettings.PopulationCap);
|
||||
}
|
||||
if (mapSettings.StartingResources)
|
||||
{
|
||||
var startingResourcesBox = Engine.GetGUIObjectByName("startingResources");
|
||||
startingResourcesBox.selected = startingResourcesBox.list_data.indexOf(mapSettings.StartingResources);
|
||||
}
|
||||
|
||||
initMapNameList();
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,10 @@
|
||||
size="0 0 100% 100%"
|
||||
tooltip_style="onscreenToolTip">
|
||||
<translatableAttribute id="tooltip">Select a map to play on.</translatableAttribute>
|
||||
<action on="SelectionChange">selectMap(this.list_data[this.selected]);</action>
|
||||
<action on="SelectionChange">
|
||||
if (this.list_data[this.selected])
|
||||
selectMap(this.list_data[this.selected]);
|
||||
</action>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user