Differential D3243 Diff 16276 binaries/data/mods/public/gui/gamesettings/attributes/DisabledTechnologies.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/DisabledTechnologies.js
- This file was added.
/** | |||||
* TODO: does this need a GUI setting? | |||||
* Also TODO: would probably be better to let maps implement custom modifiers. | |||||
*/ | |||||
GameSettings.prototype.Attributes.DisabledTechnologies = class extends GameSetting | |||||
{ | |||||
Init() | |||||
{ | |||||
this.value = undefined; | |||||
this.settings.map.watch(() => this.onMapChange(), ["map"]); | |||||
} | |||||
LegacySerialize(attribs) | |||||
{ | |||||
if (this.value) | |||||
attribs.settings.DisabledTechnologies = this.value; | |||||
} | |||||
onMapChange() | |||||
{ | |||||
if (!this.getMapSetting("DisabledTechnologies")) | |||||
this.setValue(undefined); | |||||
else | |||||
this.setValue(this.getMapSetting("DisabledTechnologies")); | |||||
} | |||||
setValue(val) | |||||
{ | |||||
this.value = val; | |||||
} | |||||
}; |
Wildfire Games · Phabricator