Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/Ceasefire.js
GameSettings.prototype.Attributes.Ceasefire = class Ceasefire extends GameSetting | GameSettings.prototype.Attributes.Ceasefire = class Ceasefire extends GameSetting | ||||
{ | { | ||||
init() | init() | ||||
{ | { | ||||
this.value = 0; | this.value = 0; | ||||
this.settings.map.watch(() => this.onMapChange(), ["map"]); | this.settings.map.watch(() => this.onMapChange(), ["map"]); | ||||
} | } | ||||
toInitAttributes(attribs) | toInitAttributes(attribs) | ||||
{ | { | ||||
if (!this.value) | |||||
return; | |||||
attribs.settings.Ceasefire = this.value; | attribs.settings.Ceasefire = this.value; | ||||
} | } | ||||
fromInitAttributes(attribs) | fromInitAttributes(attribs) | ||||
{ | { | ||||
if (!this.getLegacySetting(attribs, "Ceasefire")) | if (!this.getLegacySetting(attribs, "Ceasefire")) | ||||
this.value = 0; | this.value = 0; | ||||
else | else | ||||
Show All 18 Lines |
Wildfire Games · Phabricator