Differential D2426 Diff 12871 ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/WorldPopulation.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/WorldPopulation.js
GameSettingControls.WorldPopulation = class extends GameSettingControlCheckbox | |||||
{ | |||||
onMapChange(mapData) | |||||
{ | |||||
let mapValue = | |||||
mapData && | |||||
mapData.settings && | |||||
mapData.settings.WorldPopulation || undefined; | |||||
if (mapValue !== undefined && mapValue != g_GameAttributes.settings.WorldPopulation) | |||||
{ | |||||
g_GameAttributes.settings.WorldPopulation = mapValue; | |||||
this.gameSettingsControl.updateGameAttributes(); | |||||
} | |||||
} | |||||
onGameAttributesChange() | |||||
{ | |||||
if (!g_GameAttributes.mapType) | |||||
return; | |||||
if (g_GameAttributes.settings.WorldPopulation !== undefined) | |||||
return; | |||||
g_GameAttributes.settings.WorldPopulation = false; | |||||
this.gameSettingsControl.updateGameAttributes(); | |||||
} | |||||
onGameAttributesBatchChange() | |||||
{ | |||||
if (!g_GameAttributes.mapType) | |||||
return; | |||||
this.setChecked(g_GameAttributes.settings.WorldPopulation); | |||||
} | |||||
onPress(checked) | |||||
{ | |||||
g_GameAttributes.settings.WorldPopulation = checked; | |||||
this.gameSettingsControl.updateGameAttributes(); | |||||
this.gameSettingsControl.setNetworkGameAttributes(); | |||||
} | |||||
}; | |||||
GameSettingControls.WorldPopulation.prototype.TitleCaption = | |||||
translate("World population"); | |||||
GameSettingControls.WorldPopulation.prototype.Tooltip = | |||||
translate("When checked the Population Cap will be evenly distributed over all living players."); |
Wildfire Games · Phabricator