UI (functions)/Dialogue

From PMDOWiki
More functions: Script Reference

This page documents the ScriptUI class for Lua scripting.

As a singleton class, it can be accessed from Lua with UI.

WaitInput

UI:WaitInput(anyInput)

Waits for the player to press a button before continuing.

Parameters

Name Type Description
System.Boolean System.Boolean If false, only the Continue button will let the game continue. If true, any button will work.

Returns

Type Description
NLua.LuaFunction


WaitForPlayerInput

UI:WaitForPlayerInput(inputs)

Waits for the player to press at least one of the given inputs before continuing.
If an empty table is supplied, then this function behaves like WaitInput.

Parameters

Name Type Description
NLua.LuaTable NLua.LuaTable A table of inputs, either as InputTypes or as ints. The game will continue if any one of them are hit. If empty, any button will work.

Returns

Type Description
NLua.LuaFunction


WaitShowDialogue

UI.WaitShowDialogue

Type: NLua.LuaFunction

Displays a dialogue box with text, waiting until the player completes it.
Takes a string and an optional callback as an argument.


WaitShowTimedDialogue

UI:WaitShowTimedDialogue(text, waitTime, callbacks)

Displays a dialogue box with text, waiting until the specified time has expired.
Takes a string, integer, and an optional callback as an argument.

Parameters

Name Type Description
System.String System.String The text to display in the textbox.
System.Int32 System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input.
NLua.LuaTable NLua.LuaTable The Lua table of callbacks that the textbox can call using the [script] tag.

Returns

Type Description
NLua.LuaFunction


TextDialogue

UI:TextDialogue(text, waitTime, callbacks)

[LuaFunction] WaitShowTimedDialogue
Sets the current dialogue text to be shown. Requires WaitDialog to actually display.

Parameters

Name Type Description
System.String System.String The text to display in the textbox.
System.Int32 System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input.
NLua.LuaTable NLua.LuaTable The Lua table of callbacks that the textbox can call using the [script] tag.


ChoiceMenuYesNo

UI:ChoiceMenuYesNo(message, bdefaultstono, callbacks)

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 retrieve 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.

Parameters

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


SetCustomDialogue

UI:SetCustomDialogue(dialogue)

Displays a custom dialogue of the caller's choice.

UI:WaitDialog() must be called afterwards for the dialogue to be actually displayed,
and for execution to suspend until the dialogue is completed.

Parameters

Name Type Description
RogueEssence.Menu.DialogueBox RogueEssence.Menu.DialogueBox


References

https://github.com/RogueCollab/RogueEssence/blob/master/RogueEssence/Lua/ScriptUIDialogue.cs