Differential D1703 Diff 11331 binaries/data/mods/public/gui/gamesetup/Pages/MapBrowserPage/Controls/PreviousButton.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/Pages/MapBrowserPage/Controls/PreviousButton.js
- This file was added.
MapBrowserPageControls.PreviousButton = class | |||||
{ | |||||
constructor(mapBrowserPage, gridBrowser) | |||||
{ | |||||
this.gridBrowser = gridBrowser; | |||||
this.mapBrowserPreviousButton = Engine.GetGUIObjectByName("mapBrowserPreviousButton"); | |||||
this.mapBrowserPreviousButton.onPress = this.gridBrowser.previousPage.bind(this.gridBrowser); | |||||
this.mapBrowserPreviousButton.caption = this.caption; | |||||
this.mapBrowserPreviousButton.tooltip = colorizeHotkey(this.Tooltip, this.HotkeyConfig); | |||||
gridBrowser.registerPageChangeHandler(this.updateEnabled.bind(this)); | |||||
gridBrowser.registerGridResizeHandler(this.updateEnabled.bind(this)); | |||||
} | |||||
updateEnabled() | |||||
{ | |||||
this.mapBrowserPreviousButton.enabled = this.gridBrowser.pageCount > 1; | |||||
} | |||||
}; | |||||
MapBrowserPageControls.PreviousButton.prototype.caption = "←"; | |||||
MapBrowserPageControls.PreviousButton.prototype.HotkeyConfig = | |||||
"tab.prev"; | |||||
MapBrowserPageControls.PreviousButton.prototype.Tooltip = | |||||
translate("%(hotkey)s: Go to the previous page."); |
Wildfire Games · Phabricator