Menu
Updated for version 3.38.
Module Definition
The module is inherited from ModuleBase. So base parameters can be found there.
Note: The module is one of the original modules of BeardLib and was never really touched until version 3.38. It's still missing some features and is really only used to build menus and nodes and not the items themselves. It's used in PDTH HUD to build the options menu inside a sub menu.
I might update it or I might create a whole new module for building MenuUI menus instead which are superior than these menus.
Module name
The name of the module you use as the meta of the module definition is 'Menu' or 'MenuModule' if _force_search
is set to true in the module definition.
XML Structure
<menu parent_node name node_name title_id desc_id>
<menu parent_node name node_name title_id desc_id>
Parameter | Type | Description |
---|---|---|
parent_node | string | The key/name of the node which the menu should be parented to |
name | String | The foundation of the base name of the node. Defaults to the name of the mod plus the defined name of the module (name parameter or "Menu") |
node_name | String | The name of the node, defaults to the resulting |
title_id | String | Localization id of the title of the node's button, defaults to the resulting |
desc_id | String | Localization id of the desc of the node's button, defaults to the resulting |
<sub_menu key ...> ...
<sub_menu key ...> ...
This can be any of the parameters you see in the main menu
node. Only has an affect if key
is not specified.
Parameter | Type | Description |
---|---|---|
key | String | The key/name of the module you may or may not be referencing for the creation of the items for this menu. [OPTIONAL]. If this is specified, the 'BuildMenu' function will be called on the module with the key, to create the items for this menu. |
<item_group key/>
<item_group key/>
Parameter | Type | Description |
---|---|---|
key | String | The key/name of the module you are referencing for creating the items inside the current node. [REQ], with this the 'InitializeNode' function will be called on the module to create the items from the Module inside of the current node |
<divider name size>
<divider name size>
Parameter | Type | Description |
---|---|---|
name | String | The name of the divider |
size | Number | The height of the divider |
<merge_data ...> ...
<merge_data ...> ...
Any additional parameters you wish to be included in the table
Example
This example is what you would put inside your main node within your mod config
This will produce an options menu in the Mod Options node. With the Options sub_menu. and a divider.
Functions
Function | Description |
---|---|
BuildNode(Table node_data, Table parent_node) | Builds the node. |
BuildNodeItems(Table node, Table data) | Builds the node items. |
CreateDivider(Table node, Table tbl) | Creates a divider. |
Last updated