1
0
forked from mirrors/0ad
Files
0ad/binaries/data/mods/public/gui/reference/common/Buttons/StructreeButton.js
T
s0600204 7cde8a9df4 Rewrite the civinfo page to use OOP principles
Tested by: Nescio, Freagarach
Refs: #5387
Differential Revision: https://code.wildfiregames.com/D2822
This was SVN commit r24289.
2020-11-29 04:20:17 +00:00

28 lines
653 B
JavaScript

class StructreeButton
{
constructor(parentPage)
{
this.parentPage = parentPage;
this.civInfoButton = Engine.GetGUIObjectByName("structreeButton");
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_structree.xml" });
}
}
StructreeButton.prototype.Caption =
translate("Structure Tree");
StructreeButton.prototype.Hotkey =
"structree";
StructreeButton.prototype.Tooltip =
translate("%(hotkey)s: Switch to Structure Tree.");