Differential D3965 Diff 17595 binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/Rating.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/Rating.js
GameSettingControls.Rating = class Rating extends GameSettingControlCheckbox | GameSettingControls.Rating = class Rating extends GameSettingControlCheckbox | ||||
{ | { | ||||
constructor(...args) | constructor(...args) | ||||
{ | { | ||||
super(...args); | super(...args); | ||||
// The availability of rated games is not a GUI concern, unlike most other | // The availability of rated games is not a GUI concern, unlike most other | ||||
// potentially available settings. | // potentially available settings. | ||||
g_GameSettings.rating.watch(() => this.render(), ["enabled", "available"]); | g_GameSettings.rating.watch(() => this.render(), ["enabled", "available"]); | ||||
this.render(); | this.render(); | ||||
} | } | ||||
render() | render() | ||||
{ | { | ||||
this.setHidden(!g_GameSettings.rating.available); | this.setHidden(g_GameSettings.playerCount.nbPlayers != 2 && !g_GameSettings.rating.available); | ||||
bb: Isn't that already in the gamesettings attribute, Ratings.js? (L21) | |||||
this.setChecked(g_GameSettings.rating.enabled); | this.setChecked(g_GameSettings.rating.enabled); | ||||
this.setEnabled(g_IsNetworked && !g_GameSettings.cheats.enabled); | |||||
bbUnsubmitted Not Done Inline ActionsSounds like also done in the gamesettingsatribute already (hasXmppclient probably does it already) bb: Sounds like also done in the gamesettingsatribute already (hasXmppclient probably does it… | |||||
} | } | ||||
onPress(checked) | onPress(checked) | ||||
{ | { | ||||
g_GameSettings.rating.setEnabled(checked); | g_GameSettings.rating.setEnabled(checked); | ||||
this.gameSettingsController.setNetworkInitAttributes(); | this.gameSettingsController.setNetworkInitAttributes(); | ||||
} | } | ||||
}; | }; | ||||
GameSettingControls.Rating.prototype.TitleCaption = | GameSettingControls.Rating.prototype.TitleCaption = | ||||
translate("Rated Game"); | translate("Rated Game"); | ||||
GameSettingControls.Rating.prototype.Tooltip = | GameSettingControls.Rating.prototype.Tooltip = | ||||
translate("Toggle if this game will be rated for the leaderboard."); | translate("Toggle if this game will be rated for the leaderboard."); |
Wildfire Games · Phabricator
Isn't that already in the gamesettings attribute, Ratings.js? (L21)