Differential D3711 Diff 16562 binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/Dropdowns/PlayerColor.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/Dropdowns/PlayerColor.js
Show All 30 Lines | render() | ||||
this.values = g_GameSettings.playerColor.available; | this.values = g_GameSettings.playerColor.available; | ||||
this.dropdown.list = this.values.map(color => coloredText(this.ColorIcon, rgbToGuiColor(color))); | this.dropdown.list = this.values.map(color => coloredText(this.ColorIcon, rgbToGuiColor(color))); | ||||
this.dropdown.list_data = this.values.map((color, i) => i); | this.dropdown.list_data = this.values.map((color, i) => i); | ||||
} | } | ||||
onSelectionChange(itemIdx) | onSelectionChange(itemIdx) | ||||
{ | { | ||||
g_GameSettings.playerColor.setColor(this.playerIndex, this.values[itemIdx]); | g_GameSettings.playerColor.setColor(this.playerIndex, this.values[itemIdx]); | ||||
this.gameSettingsControl.setNetworkGameAttributes(); | this.gameSettingsControl.setNetworkInitAttributes(); | ||||
} | } | ||||
}; | }; | ||||
PlayerSettingControls.PlayerColor.prototype.Tooltip = | PlayerSettingControls.PlayerColor.prototype.Tooltip = | ||||
translate("Pick a color."); | translate("Pick a color."); | ||||
PlayerSettingControls.PlayerColor.prototype.ColorIcon = | PlayerSettingControls.PlayerColor.prototype.ColorIcon = | ||||
"■"; | "■"; |
Wildfire Games · Phabricator