Differential D2483 Diff 10823 binaries/data/mods/public/gui/gamesetup/GameSettings/PerPlayer/PlayerFrame.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/GameSettings/PerPlayer/PlayerFrame.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
class PlayerFrame | |||||
{ | |||||
constructor(playerIndex, gameSettingsControl) | |||||
{ | |||||
this.playerIndex = playerIndex; | |||||
this.gameSettingsControl = gameSettingsControl; | |||||
this.playerFrame = Engine.GetGUIObjectByName("playerFrame[" + playerIndex + "]"); | |||||
{ | |||||
let size = this.playerFrame.size; | |||||
Stan: why the scope? | |||||
Done Inline ActionsThat someone reading the code will see that the variable is only used in that scope. elexis: That someone reading the code will see that the variable is only used in that scope. | |||||
Not Done Inline ActionsAlright I assume you can't edit the gui value in place because it doesn't work? Stan: Alright I assume you can't edit the gui value in place because it doesn't work? | |||||
size.top = this.Height * this.playerIndex; | |||||
size.bottom = this.Height * (this.playerIndex + 1); | |||||
this.playerFrame.size = size; | |||||
} | |||||
gameSettingsControl.registerGameAttributesChangeHandler(this.onGameAttributesChange.bind(this)); | |||||
} | |||||
onGameAttributesChange() | |||||
{ | |||||
this.playerFrame.hidden = !this.gameSettingsControl.getPlayerData(g_GameAttributes, this.playerIndex); | |||||
} | |||||
} | |||||
PlayerFrame.prototype.Height = 32; |
Wildfire Games · Phabricator
why the scope?