UI (functions)/Custom Menus

From PMDOWiki
Revision as of 03:50, 18 January 2026 by Imbion (talk | contribs) (Created page with "== UI:SetCustomMenu(RogueEssence.Menu.InteractableMenu) == Displays a custom menu of the caller's choice. UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, and for execution to suspend until the menu is exited. == UI:BeginChoiceMenu(System.String,NLua.LuaTable,System.Object,System.Object,NLua.LuaTable) == Marks the start of a multi-choice menu. UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, and...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI:SetCustomMenu(RogueEssence.Menu.InteractableMenu)

Displays a custom menu of the caller's choice.

UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, and for execution to suspend until the menu is exited.

UI:BeginChoiceMenu(System.String,NLua.LuaTable,System.Object,System.Object,NLua.LuaTable)

Marks the start of a multi-choice menu. UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, and for execution to suspend until the choice is returned. Then to recover the integer value indicating the result of the menu, UI:ChoiceResult() must be called.


Arguments

  • message: The question to ask the user.
  • choicesPairs: A table of choices. Each choice can be either a string, or { string, bool } representing the text and enabled status.
  • defaultChoice: The cursor starts on this choice.
  • cancelChoice: This choice is chosen if the player presses the cancel button.
  • callbacks: The Lua table of callbacks for the textbox to call.

UI:BeginMultiPageMenu(System.Int32,System.Int32,System.Int32,System.String,NLua.LuaTable,System.Int32,System.Object,System.Object)

Marks the start of a multi-paged choice menu. UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, and for execution to suspend until the choice is returned. Then to recover the integer value indicating the result of the menu, UI:ChoiceResult() must be called.


Arguments

  • x: X position of the menu
  • y: Y position of the menu
  • width: Width of the menu
  • title: Height of the menu
  • choicesPairs: A table of choices. Each choice can be either a string, or { string, bool } representing the text and enabled status.
  • linesPerPage: Number of choices per page
  • defaultChoice: The cursor starts on this choice.
  • cancelChoice: This choice is chosen if the player presses the cancel button.

UI:ChoiceResult

Get the result of the last choice menu


Returns

The result of the choice

UI:GetChoiceAction(System.Object)

It's complicated.


Arguments

  • obj: None

UI:WaitForChoice

Displays the currently set choice menu and waits for the player's selection to complete.


Example


UI:WaitForChoice()

UI:__WaitForChoice

Wait for choice and then CLEAN UP m_curchoice