UI.MMX.MenuMachineX Class

From KitHack Model Club Wiki
Jump to navigation Jump to search

Back to SDK API Reference

MenuMachineX Class

This class handles the creation and management of menu sections within the UI, allowing for modular and dynamic menu structures.

Public Constant Fields

Public Fields

  • `public UIHoverRect[] hoverRects` - Array of UI hover rectangles.
  • `protected RectTransform sectionContainer` - Container for menu sections.
  • `protected ContextMenuSection sectionTemplate` - Template for creating new sections.
  • `protected TMP_Text header` - Header text component.
  • `protected ScrollRect scrollRect` - Scroll rect component.
  • `protected Dictionary<string, MenuMachineX.Section> sections` - Dictionary of menu sections.
  • `protected ScreenSpacePanel ssp` - Screen space panel component.
  • `protected List<ModularMenuItem> allItems` - List of all menu items.

Public Delegates

Public Events

Public Enums

Public Interfaces

Public Properties

  • `public override bool Hover { get; }` - Gets a value indicating whether any hover rect is hovered.
  • `public override List<ModularMenuItem> GetItems()` - Gets the list of all menu items.

Public Methods

  • `public static MenuMachineX Create(string title, ContentData itemData)` - Creates a new instance of MenuMachineX with the specified title and item data.
  • `protected void OnCreate(string title, ScreenSpacePanel ssp, ContentData itemData)` - Called during the creation of the menu.
  • `public void SetupMenu(ContentData itemData)` - Sets up the menu with the specified item data.
  • `public void SetupMenu(string title, ContentData itemData)` - Sets up the menu with the specified title and item data.
  • `protected void InitHeader(string title)` - Initializes the header with the specified title.
  • `protected void InitMenus(ContentData itemData)` - Initializes the menus with the specified item data.
  • `protected MenuMachineX.Section CreateSection(string header, int currentSectionSibIndex)` - Creates a new section with the specified header and index.
  • `public void Clear()` - Clears all sections and items from the menu.
  • `protected override void OnTerminate()` - Called when the menu is terminated.
  • `private void Sect_OnMenuItemCtrlDown(ModularMenuItem arg1, ModularContextMenu arg2)` - Handles the event when a menu item control is pressed down.
  • `private void Sect_OnMenuItemCtrlUp(ModularMenuItem arg1, ModularContextMenu arg2)` - Handles the event when a menu item control is released.

Public Structs

Public Classes

  • `public class Section` - Represents a section within the menu.
 * `public ContextMenuSection section` - The context menu section.
 * `public int order` - The order of the section.

See Also

  • UIHoverRect Class
  • RectTransform Class
  • ContextMenuSection Class
  • TMP_Text Class
  • ScrollRect Class
  • ScreenSpacePanel Class
  • ModularMenuItem Class
  • ModularContextMenu Class
  • ContentData Class
  • PrefabBase Class
  • UI.MMX.MMXMenuBase Class
  • Header Class
  • EndHeader Class