Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/MatchID.js
GameSettings.prototype.Attributes.MatchID = class MatchID extends GameSetting | GameSettings.prototype.Attributes.MatchID = class MatchID extends GameSetting | ||||
{ | { | ||||
init() | init() | ||||
{ | { | ||||
// TODO remove this assignment, this shouldn't be in persistmatchsettings. | |||||
this.matchID = 0; | this.matchID = 0; | ||||
} | } | ||||
toInitAttributes(attribs) | toInitAttributes(attribs) | ||||
{ | { | ||||
attribs.matchID = this.matchID; | attribs.matchID = this.matchID; | ||||
} | } | ||||
fromInitAttributes(attribs) | |||||
{ | |||||
if (attribs.matchID !== undefined) | |||||
this.matchID = attribs.matchID; | |||||
} | |||||
pickRandomItems() | pickRandomItems() | ||||
{ | { | ||||
if (this.matchID) | |||||
return false; | |||||
this.matchID = Engine.GetMatchID(); | this.matchID = Engine.GetMatchID(); | ||||
return true; | |||||
} | } | ||||
}; | }; |
Wildfire Games · Phabricator