Differential D3243 Diff 16556 ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/GameSpeed.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/GameSpeed.js
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
GameSettings.prototype.Attributes.GameSpeed = class GameSpeed extends GameSetting | |||||
{ | |||||
init() | |||||
{ | |||||
this.gameSpeed = 1; | |||||
this.settings.map.watch(() => this.onMapChange(), ["map"]); | |||||
} | |||||
toInitAttributes(attribs) | |||||
{ | |||||
attribs.gameSpeed = this.gameSpeed; | |||||
} | |||||
fromInitAttributes(attribs) | |||||
{ | |||||
if (!attribs.gameSpeed) | |||||
return; | |||||
this.gameSpeed = +attribs.gameSpeed; | |||||
} | |||||
onMapChange() | |||||
{ | |||||
if (!this.getMapSetting("gameSpeed")) | |||||
return; | |||||
this.setSpeed(+this.getMapSetting("gameSpeed")); | |||||
} | |||||
setSpeed(speed) | |||||
{ | |||||
this.gameSpeed = speed; | |||||
} | |||||
}; |
Wildfire Games · Phabricator