Menu Helper Plus
Updated for version 3.38.
MenuHelperPlus is effectively an extension on the 'MenuHelper' found in the base of BLT. So you will find that a lot of variable names will be the same (intentionally).
Side note: merge_data will be used a lot in this page, effectively it means a table that should be merged using table.merge. So extra variables that you want included can be put into that table and they will be added to the main table.
Functions
MenuHelperPlus:NewMenu(Table params)
This function will create a new menu, not a node a menu. As in 'start_menu' or 'pause_menu' which contains nodes.
paramsthe table of parameters for the new menu
params parameters
params parametersRequired
namethe name of menuidthe ID of the menufake_paththe string representation of the path that should be used to 'fake' the script_data function and then insert our own data into that call. (Shouldn't include an extension)init_nodea table which includes data for the initial node present in the menuinit_node : namethe name of the initial node in the menu
Optional
callback_handlerstring representation of the class which should be used as the callback handler for the menu (Default is "MenuCallbackHandler")inputstring representation of the class which should be used as the menu's 'input' (Default is "MenuInput")rendererstring representation of the class which should be used as the menu's 'renderer' (Default is "MenuRenderer")merge_datatable which contains any data that you wish to be merged with the data of the menu (Could include stuff such as new nodes, however for thisAddNodeshould be used)init_node : align_lineinit_node : back_callbackstring representation of the function that should be called upon leaving the node. (Should be a function in the callback_handler used by the menu)init_node : gui_classstring representation of the class which should be used to form the gui of the node (Defaut is "MenuNodeMainGui")init_node : menu_componentsstring which contains a list of the components which should be shown in the menu (separated with a space)init_node : modifierstring representation of the class(es) that should be used as the 'modifier' of the node (separated using a space)init_node : refreshstring representation of the class(es) that should be used as the 'refresh' object of the node (separated using a space)init_node : topic_idstring which is the ID of the topic of the nodeinit_node : legendstable of tables for legends which should be added to the nodeinit_node : legends :: namename of the legendinit_node : legends :: pcbool that determines if it should be shown when using a keyboard (Default is false)init_node : legends :: visible_callbackstring representation of a function which would return a bool that determines if the legend is visible
MenuHelperPlus:NewNode(String MenuName, Table params)
This will create a node in the menu with the name MenuName and the parameters params
MenuNameThis is the name of the menu you wish to create the node in. (Defaults to "menu_main" at the menu and "menu_pause" when in-game)paramstable of variables that are used to create the node
params parameters
params parametersnamename of the node (Required)align_lineback_callbackstring representation of the function to be called when leaving the nodegui_classstring representation of the class that should be used to create the gui of the node (Default = "MenuNodeGui")menu_componentsstring which contains a list of the components which should be shown in the menu (separated with a space)modifierstring representation of the class(es) that should be used as the 'modifier' of the node (separated using a space)refreshstring representation of the class(es) that should be used as the 'refresh' object of the node (separated using a space)stencil_alignstencil_imagetopic_idstring which is the ID of the topic of the nodetypestring representation of the class that should be used to create the node (Default = "CoreMenuNode.MenuNode")updatestring representation of the class(es) that should be used as the 'update' object of the node (separated using a space)scene_statethe scene in MenuSceneManager that should be used for the nodemerge_datatable which contains any data that you wish to be merged with the parameters of the nodelegendstable containing tables of the legends you wish to be added to the nodelegends :: namename of the legendlegends :: pcbool that determines if it should be shown when using a keyboard (Default is false)legends :: visible_callbackstring representation of a function which would return a bool that determines if the legend is visiblecallback_overwritestring representation of the class that should overwrite the menu's default callback handler
MenuHelperPlus:AddLegend(String MenuId, String node_name, Table params)
This function will add a legend to the node of name node_name with the parameters of params
MenuIdThe ID of the menu that the node is present in. (Defaults to "menu_main" at the menu and "menu_pause" when in-game)node_nameThe name of the node the legend should be added toparamsThe parameters of the legendparams :: namename of the legendparams :: pcbool that determines if it should be shown when using a keyboard (Default is false)params :: visible_callbackstring representation of a function which would return a bool that determines if the legend is visible
MenuHelperPlus:GetNode(String menu_name, String node_name)
This function will return the node in menu menu_name with the name node_name
menu_name(Defaults to "menu_main" at the menu and "menu_pause" when in-game if the passed parameter is nil)node_nameNode name (Required)
MenuHelperPlus:AddButton(Table params)
This function will add a normal button to a node of your choice with the parameters params that you define. returns the created item
paramstable of parameters (Required)params : idunique name of the button (Required)params : titlestring title of the button. Can be localization ID (Required)params : nodethe node that the button should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the button should be created on (Only required ifnodeisn't passed)params : descstring description of the button. Can be localization ID.params : callbackstring representation of the function that will be called on button press. Should be a function that is present in the node's callback handler.params : disabled_colourColorthat should be used when the button is disabled (Default = Color(0.25, 1, 1, 1))params : next_nodename of the node that should be opened on button pressparams : localizedbool to determine if the title of the button should be localized.params : localized_helpbool to determine if the description of the button should be localized.params : merge_datatable of data that should be merged with the table of parameters for the button.params : enabledbool to set whether the button is enabled or disabled.params : positionindex that the button should be inserted at in the node.
MenuHelperPlus:AddDivider(Table params)
Will create a divider in the node of your choice with the parameters params that you define. returns the created item.
paramstable of parameters (Required)params : idunique name of the divider (Required)params : nodethe node that the divider should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the divider should be created on (Only required ifnodeisn't passed)params : sizeheight of the divider.params : no_textbool to toggle the showing of text.params : merge_datatable of data that should be merged with the table of parameters for the divider.params : positionindex that the divider should be inserted at in the node.
MenuHelperPlus:AddToggle(Table params)
Will create a toggle button in the node of your choice with the parameters params that you define. returns the created item.
paramstable of parameters (Required)params : idunique name of the toggle (Required)params : nodethe node that the toggle should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the toggle should be created on (Only required ifnodeisn't passed)params : descstring description of the toggle. Can be localization ID.params : callbackstring representation of the function that will be called on toggle press. Should be a function that is present in the node's callback handler.params : disabled_colourColorthat should be used when the toggle is disabled (Default = Color(0.25, 1, 1, 1))params : localizedbool to determine if the title of the toggle should be localized.params : localized_helpbool to determine if the description of the toggle should be localized.params : icon_by_textbool which toggles the showing of an icon beside the text (Defaults to false)params : valuebool which is the default value of the node. (ticked or not ticked) (Defaults to false)params : merge_datatable of data that should be merged with the table of parameters for the toggle.params : enabledbool to set whether the toggle is enabled or disabled.params : positionindex that the toggle should be inserted at in the node.
MenuHelperPlus:AddSlider(Table params)
Will create a slider in the node of your choice with the parameters params that you define. returns the created item.
paramstable of parameters (Required)params : idunique name of the slider (Required)params : nodethe node that the slider should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the slider should be created on (Only required ifnodeisn't passed)params : descstring description of the slider. Can be localization ID.params : callbackstring representation of the function that will be called on slider press. Should be a function that is present in the node's callback handler.params : disabled_colourColorthat should be used when the slider is disabled (Default = Color(0.25, 1, 1, 1))params : localizedbool to determine if the title of the slider should be localized.params : localized_helpbool to determine if the description of the slider should be localized.params : minminimum value the slider can have.params : maxmaximum value the slider can have.params : stepvalue that the slider changes by when the arrow keys are used.params : valuestarting value of the slider.params : merge_datatable of data that should be merged with the table of parameters for the slider.params : enabledbool to set whether the slider is enabled or disabled.params : positionindex that the slider should be inserted at in the node.
MenuHelperPlus:AddMultipleChoice(Table params)
Will create a multi-choice item in the node of your choice with the parameters params that you define. returns the created item.
paramstable of parameters (Required)params : idunique name of the multi-choice (Required)params : nodethe node that the multi-choice should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the multi-choice should be created on (Only required ifnodeisn't passed)params : descstring description of the multi-choice. Can be localization ID.params : callbackstring representation of the function that will be called on multi-choice press. Should be a function that is present in the node's callback handler.params : localizedbool to determine if the title of the multi-choice should be localized.params : localized_helpbool to determine if the description of the multi-choice should be localized.params : itemstable of items that are in the multi-choiceparams : localized_itemsdetermines if the items are localizedparams : valuestarting value of the multi-choice (Default = 1)params : merge_datatable of data that should be merged with the table of parameters for the multi-choice.params : enabledbool to set whether the multi-choice is enabled or disabled.params : positionindex that the multi-choice should be inserted at in the node.
MenuHelperPlus:AddKeybinding(Table params)
Will create a keybinding button in the node of your choice with the parameters params that you define. returns the created item.
paramstable of parameters (Required)params : idunique name of the keybinding (Required)params : nodethe node that the keybinding should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the keybinding should be created on (Only required ifnodeisn't passed)params : descstring description of the keybinding. Can be localization ID.params : callbackstring representation of the function that will be called on keybinding press. Should be a function that is present in the node's callback handler.params : disabled_colourColorthat should be used when the keybinding is disabled (Default = Color(0.25, 1, 1, 1))params : localizedbool to determine if the title of the keybinding should be localized.params : localized_helpbool to determine if the description of the keybinding should be localized.params : connection_nameunique name to save the keybind as.params : bindingdefault binding on the button (Default unbound)params : buttondefault binding on the button (Default unbound)params : merge_datatable of data that should be merged with the table of parameters for the keybinding.params : positionindex that the keybinding should be inserted at in the node.
MenuHelperPlus:GetMenus()
returns the table of menus that have been created through MenuHelperPlus.
MenuHelperPlus:AddColorButton(Table params)
Will create a color button in the node of your choice with the parameters params that you define. returns the created item. The item is used to choose colors using a user friendly dialog.
paramstable of parameters (Required)params : idunique name of the keybinding (Required)params : nodethe node that the keybinding should be added to.params : menumenu that the node is present in (Not needed ifnodeis passed) (Defaults to "menu_main" at the menu and "menu_pause" when in-game)params : node_namename of the node that the keybinding should be created on (Only required ifnodeisn't passed)params : valuethe Color value of the item (Defaults to Color.white)params : descstring description of the keybinding. Can be localization ID.params : callbackstring representation of the function that will be called on keybinding press. Should be a function that is present in the node's callback handler.params : disabled_colourColorthat should be used when the keybinding is disabled (Default = Color(0.25, 1, 1, 1))params : localizedbool to determine if the title of the keybinding should be localized.params : localized_helpbool to determine if the description of the keybinding should be localized.params : merge_datatable of data that should be merged with the table of parameters for the keybinding.params : positionindex that the keybinding should be inserted at in the node.
Last updated
Was this helpful?