Differential D3243 Diff 16556 ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/AIConfigPage/AIGameSettingControl.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/AIConfigPage/AIGameSettingControl.js
class AIGameSettingControlDropdown extends GameSettingControlDropdown | class AIGameSettingControlDropdown extends GameSettingControlDropdown | ||||
{ | { | ||||
constructor(...args) | onOpenPage(playerIndex) | ||||
{ | { | ||||
super(...args); | this.playerIndex = playerIndex; | ||||
this.render(); | |||||
this.gameSettingsControl.registerAssignPlayerHandler(this.onAssignPlayer.bind(this)); | |||||
} | } | ||||
setControl(aiConfigPage) | setControl(aiConfigPage) | ||||
{ | { | ||||
aiConfigPage.registerOpenPageHandler(this.onOpenPage.bind(this)); | aiConfigPage.registerOpenPageHandler(this.onOpenPage.bind(this)); | ||||
let i = aiConfigPage.getRow(); | let i = aiConfigPage.getRow(); | ||||
this.frame = Engine.GetGUIObjectByName("aiSettingFrame[" + i + "]"); | this.frame = Engine.GetGUIObjectByName("aiSettingFrame[" + i + "]"); | ||||
this.title = this.frame.children[0]; | this.title = this.frame.children[0]; | ||||
this.dropdown = this.frame.children[1]; | this.dropdown = this.frame.children[1]; | ||||
this.label = this.frame.children[2]; | this.label = this.frame.children[2]; | ||||
let size = this.frame.size; | let size = this.frame.size; | ||||
size.top = i * (this.Height + this.Margin); | size.top = i * (this.Height + this.Margin); | ||||
size.bottom = size.top + this.Height; | size.bottom = size.top + this.Height; | ||||
this.frame.size = size; | this.frame.size = size; | ||||
this.setHidden(false); | this.setHidden(false); | ||||
} | } | ||||
onOpenPage(playerIndex) | |||||
{ | |||||
this.playerIndex = playerIndex; | |||||
this.updateSelectedValue(); | |||||
this.updateVisibility(); | |||||
} | |||||
onGameAttributesChange() | |||||
{ | |||||
for (let playerIndex = 0; playerIndex < g_MaxPlayers; ++playerIndex) | |||||
this.onGameAttributesChangePlayer(playerIndex); | |||||
} | |||||
onGameAttributesBatchChange() | |||||
{ | |||||
this.updateSelectedValue(); | |||||
} | |||||
} | } | ||||
AIGameSettingControlDropdown.prototype.Height= 28; | AIGameSettingControlDropdown.prototype.Height= 28; | ||||
AIGameSettingControlDropdown.prototype.Margin= 7; | AIGameSettingControlDropdown.prototype.Margin= 7; |
Wildfire Games · Phabricator