Differential D2483 Diff 10980 ps/trunk/binaries/data/mods/public/gui/gamesetup/Panels/GameSettingWarning.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Panels/GameSettingWarning.js
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
class GameSettingWarning | |||||
{ | |||||
constructor(gameSettingsControl, cancelButton) | |||||
{ | |||||
if (!g_IsNetworked) | |||||
return; | |||||
this.gameSettingWarning = Engine.GetGUIObjectByName("gameSettingWarning"); | |||||
gameSettingsControl.registerGameAttributesBatchChangeHandler(this.onGameAttributesBatchChange.bind(this)); | |||||
cancelButton.registerCancelButtonResizeHandler(this.onCancelButtonResize.bind(this)); | |||||
} | |||||
onGameAttributesBatchChange() | |||||
{ | |||||
let caption = | |||||
g_GameAttributes.settings.CheatsEnabled ? | |||||
this.CheatsEnabled : | |||||
g_GameAttributes.settings.RatingEnabled ? | |||||
this.RatingEnabled : | |||||
""; | |||||
this.gameSettingWarning.caption = caption; | |||||
this.gameSettingWarning.hidden = !caption; | |||||
} | |||||
onCancelButtonResize(cancelButton) | |||||
{ | |||||
let size = this.gameSettingWarning.size; | |||||
size.right = cancelButton.size.left - this.Margin; | |||||
this.gameSettingWarning.size = size; | |||||
} | |||||
} | |||||
GameSettingWarning.prototype.Margin = 10; | |||||
GameSettingWarning.prototype.CheatsEnabled = | |||||
translate("Cheats enabled."); | |||||
GameSettingWarning.prototype.RatingEnabled = | |||||
translate("Rated game."); |
Wildfire Games · Phabricator