Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/LockedTeams.js
- This file was added.
GameSettings.prototype.Attributes.LockedTeams = class extends GameSetting | |||||
{ | |||||
Init() | |||||
{ | |||||
this.enabled = false; | |||||
this.settings.map.watch(() => this.onMapChange(), ["map"]); | |||||
} | |||||
LegacySerialize(attribs) | |||||
{ | |||||
attribs.settings.LockTeams = this.enabled; | |||||
} | |||||
LegacyDeserialize(attribs) | |||||
{ | |||||
this.enabled = !!this.getLegacySetting(attribs, "LockTeams"); | |||||
} | |||||
onMapChange() | |||||
{ | |||||
if (this.settings.map.type != "scenario") | |||||
return; | |||||
this.setEnabled(!!this.getMapSetting("LockTeams")); | |||||
} | |||||
setEnabled(enabled) | |||||
{ | |||||
this.enabled = enabled; | |||||
} | |||||
}; |
Wildfire Games · Phabricator