SubMenu Option
SubMenuOption Class
General Summary
SubMenuOption
integrates a sub-menu alongside a toggleable button, enhancing the DynamicHUD with nested menu functionality.
Constructor Parameters
SubMenu Option offers 2 constructors like BooleanOption
and RunnableOption
.
name
: The display name for the sub-menu option.parentMenu
: The parentContextMenu
to which this sub-menu belongs.getter
: Supplier that determines if the sub-menu is displayed by default.setter
: Consumer that updates the visibility state of the sub-menu.
The SubMenu just like BooleanOption
and RunnableOption
also supports BooleanPool in its second constructor where you dont have to put the getter
and setter
.
Interactivity
Click: Toggles the visibility of the sub-menu and updates its state.
Render: Shows the option's name and renders the sub-menu adjacent to the parent menu.
Rendering
Color Coding: The option's text color changes based on its state (green for visible, red for hidden).
Sub-Menu Positioning: The sub-menu is positioned beside the parent menu, aligned with the selected option.
Example Usage
Last updated
Was this helpful?