UI (functions)

From PMDOWiki
More functions: Script Reference

The UI functions control UI elements, such as textboxes. Each UI function is run by using UI:[function]

Dialogue

Name Description
WaitInput Waits for the player to press a button before continuing.
WaitForPlayerInput 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.
WaitShowTimedDialogue Displays a dialogue box with text, waiting until the specified time has expired.
Takes a string, integer, and an optional callback as an argument.
TextDialogue [LuaFunction] WaitShowTimedDialogue
Sets the current dialogue text to be shown. Requires WaitDialog to actually display.
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 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.
SetCustomDialogue 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.

Fade Effects

Name Description
WaitShowVoiceOver Displays a voice over, waiting until the player completes it.
TextVoiceOver [LuaFunction] WaitShowVoiceOver
Sets the current voice-over text to be shown. Requires WaitDialog to actually display.
TextPopUp Makes text pop up in the bottom-left corner by default. Displays concurrently with any other process.
WaitShowTitle Fades in text in the format of a title drop, then waits until the fade-in is complete.
TextShowTitle [LuaFunction] WaitShowTitle
Fades in text in the format of a title drop. Requires WaitDialog to actually display.
WaitHideTitle Fades out the text set in a title drop, waiting until the fade-out is complete.
TextFadeTitle [LuaFunction] WaitHideTitle
Fades out the text set in a title drop. Requires WaitDialog to actually fade.
WaitShowBG Fades in a chosen background image, with a chosen framerate, at a certain fade time, waiting until the fade-in is complete.
ShowBG [LuaFunction] WaitShowBG
Prepares to fade in a chosen background image, with a chosen framerate, at a certain fade time. Requires WaitDialog to actually display.
WaitHideBG Fades out the current background image, waiting until the fade-out is complete.
FadeBG [LuaFunction] WaitHideBG
Prepares a fade-out of the current image. Requires WaitDialog to actually display.

Speakers

Name Description
ExportSpeakerSettings Exports the speaker settings as a lua table.
ImportSpeakerSettings Imports speaker settings from a lua table.
ResetSpeaker Clears the current speaker, so none is displayed the next time TextDialogue is called.
This also resets any custom dialogue box positions, portrait positions, and choice positions.
SetSpeaker Sets the speaker to be displayed during the following calls to the TextDialogue functions. It resets speaker emotion.
SetSpeaker Sets the speaker to be displayed during the following calls to the TextDialogue functions.
It takes an existing GroundChar as a parameter.
It resets speaker emotion.
SetSpeaker Sets the speaker to be displayed during the following calls to the TextDialogue functions.
It takes an existing Character as a parameter.
It resets speaker emotion.
SetSpeakerReverse Reverses the speaker orientation to face left instead of right. This depends on the boolean passed in.
SetChoiceLoc Sets the position of the choices for a question dialog.
ResetChoiceLoc Sets the position of the choices for a question dialog back to default.
SetBounds Sets the position and size of the dialogue box.
ResetBounds Resets the position and size of the dialogue box.
SetCenter Sets the centering of the text in the textbox.
SetSpeakerLoc Sets the position of the speaker in a dialogue box.
ResetSpeakerLoc Resets the position of the speaker in a dialogue box.
SetSpeakerEmotion Sets the emotion of the speaker in the dialogue box.
SetAutoFinish Makes the text automatically finish when it shows up.
SetSe Sets the speaker sound effect and speak frames played in the TextDialogue functions.
SetSe Sets the speaker sound effect played in the TextDialogue functions.
SetSpeakTime Sets the speak frames played in the TextDialogue functions.
ResetSe Resets to the default speaker sound effect and speaker frames.
WaitDialog Displays the currently set dialogue box and waits for the player to complete it.
Main article: UI (functions)/Menus
Name Description
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 retrieve the integer value indicating the result of the menu, UI:ChoiceResult() must be called.
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 retrieve the integer value indicating the result of the menu, UI:ChoiceResult() must be called.
SetCustomMenu 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.
ChoiceResult Get the result of the last choice menu
GetChoiceAction Creates an action that sets the choice result to a specified object.
WaitForChoice Displays the currently set choice menu and waits for the player's selection to complete.
ProcessMenuCoroutine Opens the provided menu and starts the menu coroutine.
This should be called only from non-coroutine sources.

Function Menus

Name Description
NameMenu Displays the name input box.

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 string value indicating the result of the menu, UI:ChoiceResult() must be called.
AssemblyMenu Displays a menu for replacing party members with the assembly.

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 boolean value indicating whether the team composition was changed or not, UI:ChoiceResult() must be called.
ShopMenu Displays the Shop 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 retrieve the table indicating the indices of items chosen, UI:ChoiceResult() must be called.
SellMenu Displays the Sell 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 retrieve the table indicating the indices of items to sell, UI:ChoiceResult() must be called.
StorageMenu Displays the Storage menu for which to exchange items in the inventory with.

UI:WaitForChoice() must be called afterwards for the menu to be actually displayed,
and for execution to suspend until the menu is exited.
WithdrawMenu Displays the Storage menu for which to withdraw from.

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

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

UI:WaitForChoice() must be called afterwards for the menu to be actually displayed,
and for execution to suspend until the menu is exited.
AppraiseMenu Displays the Appraisal 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 retrieve the table indicating the indices of items chosen, UI:ChoiceResult() must be called.
TutorTeamMenu Displays the Tutor Team 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 retrieve the integer representing the chosen team member, UI:ChoiceResult() must be called.
RelearnMenu Displays the Relearn menu for a character.

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 representing the chosen skill, UI:ChoiceResult() must be called.
LearnMenu Displays the Learn menu for a character to replace an existing skill with a new one.

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 representing the chosen skill, UI:ChoiceResult() must be called.
ForgetMenu Displays the Forget menu for a character to forget a skill.

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 representing the chosen skill, UI:ChoiceResult() must be called.
ShowPromoteMenu Displays the Promote menu to choose a team member to promote.

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 representing the chosen team slot, UI:ChoiceResult() must be called.
CanSwapMenu Determines if the swap menu has any valid items to display.
SwapMenu Displays the swap menu with a table of goods and prices.
TributeMenu Displays the tribute menu.
ShowMusicMenu Displays the Music menu to browse music for the game.

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 string representing the chosen song, UI:ChoiceResult() must be called.
DungeonChoice Ask to enter a destintion 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.
DestinationMenu Marks the start of a choice menu for choosing destinations, showing a preview of restrictions and requirements for dungeons.
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 ZoneLoc indicating the chosen destination, UI:ChoiceResult() must be called.

Multiplayer

Name Description
ServersMenu Displays the Servers menu.
ContactsMenu Displays the contacts menu.
SOSMenu Displays the SOS menu.
AOKMenu Displays the AOK menu.
PeersMenu Displays the Peers menu.
ShowConnectMenu Displays the connection menu.
CurrentActivityMenu Displays the current activity of the connected peer.
ChooseMonsterMenu Marks the start of a choice menu for choosing monsters, showing a preview of their appearances via portrait.
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 string indicating the chosen species, UI:ChoiceResult() must be called.

Misc

Main article: UI (functions)/Misc
Name Description
Reset Resets te entire UI instance.
SetupLuaFunctions Initializes any LuaFunctions found in the class.
Automatically on lua initialization.