UI (functions)/Choice Menu: Difference between revisions
From PMDOWiki
Created page with "== UI:SetChoiceLoc(System.Int32,System.Int32) == Sets the position of the choices for a question dialog. === Arguments === * <code>x</code>: The X position * <code>y</code>: The Y position == UI:ResetChoiceLoc == Sets the position of the choices for a question dialog back to default. == UI:ChoiceMenuYesNo(System.String,System.Boolean,NLua.LuaTable) == Ask a question answered by yes or no via character dialogue to the player. UI:WaitForChoice() must be called..." |
No edit summary |
||
| Line 1: | Line 1: | ||
== | == SetChoiceLoc == | ||
Sets the position of the choices for a question dialog. | Sets the position of the choices for a question dialog. | ||
=== Arguments === | === Arguments === | ||
== ResetChoiceLoc == | |||
== | |||
Sets the position of the choices for a question dialog back to default. | 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. | 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, | UI:WaitForChoice() must be called afterwards for the menu to be actually displayed, | ||
and for execution to suspend until the choice is returned. | 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. | 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. | The Yes/No menu returns 1 for yes, and 0 for no. | ||
{{FuncUsage|nmspace=UI|nm=ChoiceMenuYesNo|args=message, defaultWhenNo, callbacks}} | |||
=== Arguments === | === Arguments === | ||
{|class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=message | |||
|type=String | |||
|techt=System.String | |||
|purp=Question to be asked to the user. | |||
}} | |||
{{ArgRow | |||
|name=defaultWhenNo | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=Whether the cursor starts on no by default | |||
}} | |||
{{ArgRow | |||
|name=callbacks | |||
|type=Lua Table | |||
|techt=NLua.LuaTable) | |||
|purp= The Lua table of callbacks for the textbox to call. | |||
}} | |||
|} | |||
Revision as of 11:48, 18 January 2026
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. |
