mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Adopt the new interface by all pages which close themself. (Not thous using `Engine.SwitchGuiPage`.)
32 lines
696 B
JavaScript
32 lines
696 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()
|
|
{
|
|
this.parentPage.closePageCallback({
|
|
"nextPage": "page_structree.xml",
|
|
"args": {
|
|
"civ": this.parentPage.activeCiv
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
StructreeButton.prototype.Caption =
|
|
translate("Structure Tree");
|
|
|
|
StructreeButton.prototype.Hotkey =
|
|
"structree";
|
|
|
|
StructreeButton.prototype.Tooltip =
|
|
translate("%(hotkey)s: Switch to Structure Tree.");
|