1
0
forked from mirrors/0ad
Files
0ad/binaries/data/mods/public/gui/reference/common/Buttons/CivInfoButton.js
T
s0600204 b2842e8021 Rewrite Structure Tree and Template Viewer to use OOP principles
Commenters: elexis, Stan, Angen
Refs.: #5387
Differential Revision: https://code.wildfiregames.com/D2734
This was SVN commit r23808.
2020-07-07 19:11:36 +00:00

28 lines
653 B
JavaScript

class CivInfoButton
{
constructor(parentPage)
{
this.parentPage = parentPage;
this.civInfoButton = Engine.GetGUIObjectByName("civInfoButton");
this.civInfoButton.onPress = this.onPress.bind(this);
this.civInfoButton.caption = this.Caption;
this.civInfoButton.tooltip = colorizeHotkey(this.Tooltip, this.Hotkey);
}
onPress()
{
Engine.PopGuiPage({ "civ": this.parentPage.activeCiv, "nextPage": "page_civinfo.xml" });
}
}
CivInfoButton.prototype.Caption =
translate("Civilization Overview");
CivInfoButton.prototype.Hotkey =
"civinfo";
CivInfoButton.prototype.Tooltip =
translate("%(hotkey)s: Switch to Civilization Overview.");