Differential D3243 Diff 16284 binaries/data/mods/public/gui/gamesettings/attributes/StartingTechnologies.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/StartingTechnologies.js
- This file was added.
/** | |||||
* TODO: this doesn't have a GUI setting. | |||||
*/ | |||||
GameSettings.prototype.Attributes.StartingTechnologies = class extends GameSetting | |||||
{ | |||||
Init() | |||||
{ | |||||
this.value = undefined; | |||||
this.settings.map.watch(() => this.onMapChange(), ["map"]); | |||||
} | |||||
LegacySerialize(attribs) | |||||
{ | |||||
if (this.value) | |||||
attribs.settings.StartingTechnologies = this.value; | |||||
} | |||||
LegacyDeserialize(attribs) | |||||
{ | |||||
if (!this.getLegacySetting(attribs, "StartingTechnologies")) | |||||
this.setValue(undefined); | |||||
else | |||||
this.setValue(this.getLegacySetting(attribs, "StartingTechnologies")); | |||||
} | |||||
onMapChange() | |||||
{ | |||||
if (!this.getMapSetting("StartingTechnologies")) | |||||
this.setValue(undefined); | |||||
else | |||||
this.setValue(this.getMapSetting("StartingTechnologies")); | |||||
} | |||||
setValue(val) | |||||
{ | |||||
this.value = val; | |||||
} | |||||
}; |
Wildfire Games · Phabricator