Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/pregame/MainMenuItemHandler.js
Show All 32 Lines | buttons.forEach((button, i) => { | ||||
return; | return; | ||||
button.size = new GUISize( | button.size = new GUISize( | ||||
0, (this.ButtonHeight + this.Margin) * i, | 0, (this.ButtonHeight + this.Margin) * i, | ||||
0, (this.ButtonHeight + this.Margin) * i + this.ButtonHeight, | 0, (this.ButtonHeight + this.Margin) * i + this.ButtonHeight, | ||||
0, 0, 100, 0); | 0, 0, 100, 0); | ||||
button.caption = item.caption; | button.caption = item.caption; | ||||
button.tooltip = item.tooltip; | button.tooltip = item.tooltip; | ||||
button.enabled = item.enabled === undefined || item.enabled; | button.enabled = item.enabled === undefined || item.enabled(); | ||||
button.onPress = this.pressButton.bind(this, item, i); | button.onPress = this.pressButton.bind(this, item, i); | ||||
button.hidden = false; | button.hidden = false; | ||||
}); | }); | ||||
if (buttons.length < menuItems.length) | if (buttons.length < menuItems.length) | ||||
error("GUI page has space for " + buttons.length + " menu buttons, but " + menuItems.length + " items are provided!"); | error("GUI page has space for " + buttons.length + " menu buttons, but " + menuItems.length + " items are provided!"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator