Enfusion Script API
Loading...
Searching...
No Matches
MenuBase Interface Reference

Base class for menus in menu manager order callbacks call: opening: 1) OnMenuInit - called during load, when MenuManager loading menus config 2) OnMenuOpen - called when menu is beeing open 3) OnMenuShow 4) OnMenuFocusGained 5) OnMenuOpened - called after menu is opened and is ready. More...

Inheritance diagram for MenuBase:
MessageBox

Public Member Functions

proto external int GetUserData ()
 Returns user id uint, set on menu opening.
 
proto external MenuManager GetManager ()
 
proto external Widget GetRootWidget ()
 
proto external Widget GetItemWidget (string menuItemName)
 Returns pointer to widget associated with MenuItem (defined in menu config). If there is no MenuItem with given name, or there is no widget associated to it, returns nullptr.
 
proto external MenuBase SetLabel (string menuItemName, string text)
 Sets text to widget associated with MenuItem (works only with text containing widgets like ButtonWidget, TextWidget, MultilineTextWidget, RichTextWidget, on other widgets do nothing)
 
proto external void Close ()
 Put menu into queue for closing (which is processed during next MenuManeger update)
 
proto external bool IsFocused ()
 
proto external bool IsOpen ()
 
proto external bool AddMenuItem (string menuItemName, Widget w, string actionName)
 
proto external bool RemoveMenuItem (string menuItemName)
 
proto external void SetActionContext (string actionContextName)
 
proto MenuBase BindItem (string menuItemName, MenuItemCallback callback)
 Registers MenuItem callback.
 
void OnMenuFocusGained ()
 
void OnMenuFocusLost ()
 
void OnMenuShow ()
 
void OnMenuHide ()
 
void OnMenuOpen ()
 
void OnMenuOpened ()
 
void OnMenuClose ()
 
void OnMenuInit ()
 
void OnMenuUpdate (float tDelta)
 
void OnMenuItem (string menuItemName, bool changed, bool finished)
 

Detailed Description

Base class for menus in menu manager order callbacks call: opening: 1) OnMenuInit - called during load, when MenuManager loading menus config 2) OnMenuOpen - called when menu is beeing open 3) OnMenuShow 4) OnMenuFocusGained 5) OnMenuOpened - called after menu is opened and is ready.

loop: OnMenuUpdate OnMenuItem

closing: 1) OnMenuFocusLost - called when menu is closed or other menu/dialog going to overlap the menu 2) OnMenuHide 3) OnMenuClose

Member Function Documentation

◆ AddMenuItem()

proto external bool MenuBase.AddMenuItem ( string menuItemName,
Widget w,
string actionName )

◆ BindItem()

proto MenuBase MenuBase.BindItem ( string menuItemName,
MenuItemCallback callback )

Registers MenuItem callback.

Callback is called when:

  • Widget associated with MenuItem is clicked or changed (details are contained in MenuItemEvent argument of callback)
  • InputAction associated with MenuItem is triggered

◆ Close()

proto external void MenuBase.Close ( )

Put menu into queue for closing (which is processed during next MenuManeger update)

◆ GetItemWidget()

proto external Widget MenuBase.GetItemWidget ( string menuItemName)

Returns pointer to widget associated with MenuItem (defined in menu config). If there is no MenuItem with given name, or there is no widget associated to it, returns nullptr.

◆ GetManager()

proto external MenuManager MenuBase.GetManager ( )

◆ GetRootWidget()

proto external Widget MenuBase.GetRootWidget ( )

◆ GetUserData()

proto external int MenuBase.GetUserData ( )

Returns user id uint, set on menu opening.

◆ IsFocused()

proto external bool MenuBase.IsFocused ( )

◆ IsOpen()

proto external bool MenuBase.IsOpen ( )

◆ OnMenuClose()

void MenuBase.OnMenuClose ( )

◆ OnMenuFocusGained()

void MenuBase.OnMenuFocusGained ( )

◆ OnMenuFocusLost()

void MenuBase.OnMenuFocusLost ( )

◆ OnMenuHide()

void MenuBase.OnMenuHide ( )

◆ OnMenuInit()

void MenuBase.OnMenuInit ( )

◆ OnMenuItem()

void MenuBase.OnMenuItem ( string menuItemName,
bool changed,
bool finished )

◆ OnMenuOpen()

void MenuBase.OnMenuOpen ( )

◆ OnMenuOpened()

void MenuBase.OnMenuOpened ( )

◆ OnMenuShow()

void MenuBase.OnMenuShow ( )

◆ OnMenuUpdate()

void MenuBase.OnMenuUpdate ( float tDelta)

◆ RemoveMenuItem()

proto external bool MenuBase.RemoveMenuItem ( string menuItemName)

◆ SetActionContext()

proto external void MenuBase.SetActionContext ( string actionContextName)

◆ SetLabel()

proto external MenuBase MenuBase.SetLabel ( string menuItemName,
string text )

Sets text to widget associated with MenuItem (works only with text containing widgets like ButtonWidget, TextWidget, MultilineTextWidget, RichTextWidget, on other widgets do nothing)


The documentation for this interface was generated from the following file: