The tab menu (fl_tab_menu): the full screen menu that opens in place of the scoreboard,
with a bar of buttons at the top and one content panel open at a time.
The gamemode creates it through the theme's 'tab_menu' panel when the scoreboard key is
pressed. Plugins add their entries in the AddTabMenuItems hook by calling add_menu_item
with the class of the panel to open. When an entry is clicked the menu creates that panel,
sizes it with the panel's get_menu_size, calls its rebuild and runs the
OnMenuPanelOpen hook. The panel that was open when the menu closed is opened again the
next time. open_panel switches to another entry and close_menu closes the menu, which
runs the OnTabMenuClosed hook. set_faded fades the menu out of the way, so that the
world behind it can be seen while something is dragged out of it. Code that wants the menu
opened or closed goes through Flux.TabMenu.
Summary
Methods
Methods
Builds the full screen tab menu: slides the button bar in, collects the menu items through the AddTabMenuItems hook, creates a button for each of them and opens the panel that was open last time, or the default one.
Checks whether the menu has been faded out with set_faded.
Returns
- Boolean
Closes the menu when the TAB key is pressed.
Parameters
- key Number key code, one of the KEY_ enums
Shows the panel of a menu item, as if its button had been clicked.
Parameters
- id String ID the item was added under with add_menu_item
Returns
- Boolean false if the menu has no such item
Delegates drawing of the menu to the active theme's PaintTabMenu hook.
Parameters
- w Number panel width
- h Number panel height
Fades the whole menu out, its blur and tint included, so that the world behind it can be seen, or fades it back in. The menu keeps taking the mouse while it is faded: panels fade it while something is dragged out of them onto the world, and the drop still reaches the receivers of the menu. Does nothing while the menu is closing.
Parameters
- faded Boolean true to fade the menu out, false to bring it back
Deactivates the active button once its panel is gone.