UI (functions)/Choice Menu

From PMDOWiki

SetChoiceLoc

Sets the position of the choices for a question dialog.

Arguments

ResetChoiceLoc

Sets the position of the choices for a question dialog back to default.

ChoiceMenuYesNo

Ask a question answered by yes or no via character dialogue to the player. 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.

The Yes/No menu returns 1 for yes, and 0 for no.

Argument order is UI:ChoiceMenuYesNo(message, defaultWhenNo, callbacks).

Arguments

Name Type Technical Type Purpose
message String System.String Question to be asked to the user.
defaultWhenNo Boolean System.Boolean Whether the cursor starts on no by default
callbacks Lua Table NLua.LuaTable The Lua table of callbacks for the textbox to call.

BeginChoiceMenu

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. Argument order is UI:BeginChoiceMenu().

Arguments

Name Type Technical Type Purpose
msg String System.String The question to ask the user.
choices LuaTable NLua.LuaTable A table of choices. Each choice can be either a string, or { string, bool } representing the text and enabled status.
defaultChoice Object System.Object The cursor starts on this choice
cancelChoice Object System.Object This choice is chosen if the player presses the cancel button.
callbacks LuaTable NLua.LuaTable The Lua table of callbacks for the textbox to call.

BeginMultiPageMenu

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. Argument order is UI:().

Arguments

Name Type Technical Type Purpose
x Integer System.Int32 X position of the menu
y Integer System.Int32 Y position of the menu
width Integer System.Int32 Width of the menu
title String System.String Height of the menu
choices LuaTable NLua.LuaTable A table of choices. Each choice can be either a string, or { string, bool } representing the text and enabled status.
linesPerPage Integer System.Int32 Number of choices per page
defaultChoice Object System.Object The cursor starts on this choice.
cancelChoice Object System.Object This choice is chosen if the player presses the cancel

ChoiceResult

Get the result of the last choice menu

Returns

The result of the choice

GetChoiceAction

undocumented

WaitForChoice

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

Example


WaitForChoice()

__WaitForChoice

Wait for choice and then CLEAN UP m_curchoice