Opens and closes the tab menu from code. The tab menu is the full screen menu that takes the place of the scoreboard (the fl_tab_menu panel, or whatever the active theme has registered as its 'tab_menu' panel); the gamemode opens it with Flux.TabMenu:open when the scoreboard key is pressed and plugins can do the same, for example to bring the player to their inventory. The menu that is open is kept in Flux.tab_menu. OnTabMenuOpened and OnTabMenuClosed are run when it opens and closes. The server reaches the menu of a player through Flux.Player:open_tab_menu and Flux.Player:close_tab_menu, or Player:open_tab_menu and Player:close_tab_menu.

Summary

Methods

close()client
Closes the tab menu if it is open.
Returns the tab menu if it is open.
is_open()client
Checks whether the tab menu is open.
Opens the tab menu, or returns the one that is open already.

Methods

Flux.TabMenu:close()

client packages/active_ui/lib/sh_tab_menu.lua:87

Closes the tab menu if it is open. The menu plays its closing animation and is removed afterwards.

Returns

  • Boolean true if the menu was open and has been told to close

Flux.TabMenu:get_panel()

client packages/active_ui/lib/sh_tab_menu.lua:20

Returns the tab menu if it is open. A menu that is playing its closing animation does not count as open any more.

Returns

  • Panel the tab menu, or nil if it is not open

Flux.TabMenu:is_open()

client packages/active_ui/lib/sh_tab_menu.lua:30

Checks whether the tab menu is open.

Returns

  • Boolean

Flux.TabMenu:open(panel_id)

client packages/active_ui/lib/sh_tab_menu.lua:45

Opens the tab menu, or returns the one that is open already. Without an item the menu shows the one that was open the last time, or its default one.

-- Open the tab menu on the inventory.
Flux.TabMenu:open('inventory')

Parameters

  • panel_id String optional, defaults to nil ID of the menu item to show, as it was given to the menu's add_menu_item; the menu falls back to its default item if there is no such item

Returns

  • Panel the tab menu, or nil if it could not be opened: the local player is not ready yet, a ShouldScoreboardShow handler has returned false or the theme has not created the panel

Defined in