UI (functions)

From PMDOWiki
Revision as of 20:12, 17 January 2026 by Imbion (talk | contribs)
More functions: Script Reference

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

WaitInput

Waits for the player to press a button, before continuing the game's script.


WaitShowDialogue

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


Arguments

Argument order is UI:WaitShowDialouge(text, callbacks)

Name Type Technical Type Purpose Required
text String ? The text to display with the textbox. Yes
callbacks Lua Table ? A table of callbacks to be called by the textbox for customization features. No

Example


UI:WaitShowDialogue("Hello World!")

WaitShowTimedDialogue

Displays a dialogue box with text, waiting until the specified time has expired.


Arguments

Argument order is UI:WaitShowTimedDialouge(text, waitTime, callbacks)

Name Type Technical Type Purpose Required
text String ? The text to display with the textbox. Yes
waitTime Integer ? The time for the textbox to remain on screen. Pass -1 to wait for layer input. Yes
callbacks Lua Table ? A table of callbacks to be called by the textbox for customization features. No

Example


UI:WaitShowTimedDialogue("Hello World!", 120)

TextDialogue

Sets the current dialogue text to be shown. Requires WaitDialog to actually display.

Arguments

Argument order is UI:TextDialogue(text, waitTime, callbacks)

Name Type Technical Type Purpose Required
text String System.String The text to display with the textbox. Yes
waitTime Integer System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input. No
callbacks Lua Table NLua.LuaTable A table of callbacks to be called by the textbox for customization features. No


WaitShowVoiceOver

Displays a voice over, waiting until the player completes it.


Arguments

Argument order is UI:WaitShowVoiceOver(text, expireTime, x, y, width, height, callbacks)

Name Type Technical Type Purpose Required
text String System.String The text to display with the textbox. Yes
expireTime Integer System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input. No
x Integer System.Int32 The starting X position of the box. No
y Integer System.Int32 The starting Y position of the box No
width Integer System.Int32 The width of the box. No
height Integer System.Int32 The height of the box. No
callbacks Lua Table NLua.LuaTable A table of callbacks to be called by the textbox for customization features. No

Example


UI:WaitShowVoiceOver("Hello World!", 120)

TextVoiceOver

Sets the current voice-over text to be shown. Requires WaitDialog to actually display.


Arguments

Argument order is UI:TextVoiceOver(text, expireTime, x, y, width, height, callbacks)

Name Type Technical Type Purpose Required
text String System.String The text to display with the textbox. Yes
expireTime Integer System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input. No
x Integer System.Int32 The starting X position of the box. No
y Integer System.Int32 The starting Y position of the box No
width Integer System.Int32 The width of the box. No
height Integer System.Int32 The height of the box. No
callbacks Lua Table NLua.LuaTable A table of callbacks to be called by the textbox for customization features. No

TextPopUp

Makes text pop up in the bottom-left corner by default. Displays concurrently with any other process.


Arguments

Argument order is UI:TextPopUp(text, expireTime, x, y, width, height, callbacks)

Name Type Technical Type Purpose Required
text String System.String The text to display with the textbox. Yes
expireTime Integer System.Int32 The time for the textbox to remain on screen. Pass -1 to wait for layer input. No
x Integer System.Int32 The starting X position of the box. No
y Integer System.Int32 The starting Y position of the box No
width Integer System.Int32 The width of the box. No
height Integer System.Int32 The height of the box. No
centerH Boolean System.Boolean True if the text should be centered horizontally. No
centerV Boolean System.Boolean True if the text should be centered vertically. No

WaitShowTitle

Fades in a title text, waiting until the fade-in is complete.

Arguments

Argument order is UI:WaitShowTitle(text, time)

Name Type Technical Type Purpose Required
text String System.String The text to display with the textbox. Yes
time Integer System.Int32 How long the text takes to fade in. No
  • text: The text to display.
  • time: The time for the text to fade in.

Example


UI:WaitShowTitle("Hello World!", 60)

UI:TextShowTitle(System.String,System.Int32)

Shows text in the format of a title drop. Requires WaitDialog to actually display.


Arguments

  • text: The text to display.
  • time: The time for the text to fade in.

UI:WaitHideTitle

Fades out the currently displayed title, waiting until the fade-out is complete.


Arguments

  • time: The time for the text to fade in.

Example


UI:WaitHideTitle(60)

UI:TextFadeTitle(System.Int32)

Fades out the text set in a title drop. Requires WaitDialog to actually fade.


Arguments

  • time: The time for the text to fade in.

UI:WaitShowBG

Fades in a chosen background image, with a chosen framerate, at a certain fade time, waiting until the fade-in is complete.


Arguments

  • bg: The background to show, from the list of BG textures.
  • frameTime: Framerate of the image animation.
  • fadeInTime: Time taken to fade in the image.

Example


UI:WaitShowBG("TestBG", 3, 60)

UI:ShowBG(System.String,System.Int32,System.Int32)

Sets an image to display. Requires WaitDialog to actually display.


Arguments

  • bg: The background to show, from the list of BG textures.
  • frameTime: Framerate of the image animation.
  • fadeInTime: Time taken to fade in the image.

UI:WaitHideBG

Fades out the current background image, waiting until the fade-out is complete.


Arguments

  • time: Time taken to fade out the image.

Example


UI:WaitHideBG(60)

UI:FadeBG(System.Int32)

Prepares a fade-out of the current image. Requires WaitDialog to actually display.


Arguments

  • time: Time taken to fade out the image.

UI:ResetSpeaker(System.Boolean)

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.


Arguments

  • keysound: If turned on, the text from the dialogue boxes make sounds. Default is on.

UI:SetSpeaker(System.String,System.Boolean,System.String,System.Int32,System.String,RogueEssence.Data.Gender)

Sets the speaker to be displayed during the following calls to the TextDialogue functions. It resets speaker emotion.


Arguments

  • name: Speaker name.
  • keysound: Plays sounds when text appears.
  • specie: Species of the speaker
  • form: Form of the speaker
  • skin: Skin of the speaker
  • gender: Gender of the speaker

UI:SetSpeaker(RogueEssence.Ground.GroundChar,System.Boolean)

Sets the speaker to be displayed during the following calls to the TextDialogue functions. It resets speaker emotion.


Arguments

  • chara: Character to set as speaker. This is a character in a ground map.
  • keysound: Plays sounds when text appears.

UI:SetSpeaker(RogueEssence.Dungeon.Character,System.Boolean)

Sets the speaker to be displayed during the following calls to the TextDialogue functions. It resets speaker emotion.


Arguments

  • chara: Character to set as speaker. This is a character in a dungeon map.
  • keysound: Plays sounds when text appears.

UI:SetSpeakerReverse(System.Boolean)

Reverses the speaker orientation to face left instead of right. This depends on the boolean passed in.


Arguments

  • reverse: Faces right if false, left if true.

UI:SetChoiceLoc(System.Int32,System.Int32)

Sets the position of the choices for a question dialog.


Arguments

  • x: The X position
  • y: The Y position

UI:ResetChoiceLoc

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


UI:SetBounds(System.Int32,System.Int32,System.Int32,System.Int32)

Sets the position and size of the dialogue box.


Arguments

  • x: The X position of the box
  • y: The Y position of the box
  • width: Width of the box
  • height: Height of the box

UI:SetSe(System.String,System.Int32)

Sets the speaker sound effect and speak frames played in the TextDialogue functions.


Arguments

  • newSe: The sound effect of the box
  • speakTime: The amount of frames to wait between each sound effect

Example


UI:SetSe("Battle/_UNK_DUN_Water_Drop", 3)

UI:SetSe(System.String)

Sets the speaker sound effect played in the TextDialogue functions.


Arguments

  • newSe: The sound effect of the box

Example


UI:SetSe("Menu/Unknown-3")

UI:SetSpeakTime(System.Int32)

Sets the speak frames played in the TextDialogue functions.


Arguments

  • speakTime: The amount of frames to wait between each sound effect

Example


UI:SetSpeakTime(10)

UI:ResetSe

Resets to the default speaker sound effect and speaker frames.


UI:ResetBounds

Resets the position and size of the dialogue box.


UI:SetSpeakerLoc(System.Int32,System.Int32)

Sets the position of the speaker in a dialogue box.


Arguments

  • x: The X position
  • y: The Y position

UI:ResetSpeakerLoc

Resets the position of the speaker in a dialogue box.


UI:SetSpeakerEmotion(System.String,System.Boolean)

Sets the emotion of the speaker in the dialogue box.


Arguments

  • emo: Emotion to display
  • reverse: Faces right if false, left if true.

UI:SetCenter(System.Boolean,System.Boolean)

Sets the centering of the text in the textbox.


Arguments

  • centerH: Horizontal centering
  • centerV: Vertical centering

UI:SetAutoFinish(System.Boolean)

Makes the text automatically finish when it shows up.


Arguments

  • autoFinish: Auto-finishes text if true.

WaitDialog

Displays the currently set dialogue box and waits for the player to complete it.


Example


UI:WaitDialog()

UI:_DummyWait

Instantly break. Used as default/invalid value when returning a yieldable value.


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


Arguments

  • message: Question to be asked to the user.
  • bdefaultstono: Whether the cursor starts on no by default
  • callbacks: The Lua table of callbacks for the textbox to call.

UI:NameMenu(System.String,System.String,System.Int32,System.String)

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 recover the string value indicating the result of the menu, UI:ChoiceResult() must be called.


Arguments

  • title: The text to show above the input line.
  • desc: The text to show below the input line.
  • maxLength: The length of the text in pixels.
  • defaultName: Name to start the textbox with.

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 recover the boolean value indicating whether the team composition was changed or not, UI:ChoiceResult() must be called.


ShopMenu(NLua.LuaTable)

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 recover the table indicating the indices of items chosen, UI:ChoiceResult() must be called.


Arguments

  • goods: A table of items to be sold. The format is { Item=InvItem, Price=int } for each item.

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 recover 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(NLua.LuaTable)

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.


Arguments

  • appraisalMap: A table of mappings from containers to items, in the format of { Box=InvItem , Item=InvItem }

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 recover the table indicating the indices of items chosen, UI:ChoiceResult() must be called.


TutorTeamMenu(NLua.LuaFunction)

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 recover the integer representing the chosen team member, UI:ChoiceResult() must be called.


RelearnMenu(RogueEssence.Dungeon.Character)

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 recover the integer representing the chosen skill, UI:ChoiceResult() must be called.


Arguments

  • chara: The character to relearn skills

LearnMenu(RogueEssence.Dungeon.Character,System.String)

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 recover the integer representing the chosen skill, UI:ChoiceResult() must be called.


Arguments

  • chara: The character to relearn skills
  • skillNum: The new skill

ForgetMenu(RogueEssence.Dungeon.Character)

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 recover the integer representing the chosen skill, UI:ChoiceResult() must be called.


Arguments

  • chara: The character to relearn skills

UI: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 recover the integer representing the chosen team slot, UI:ChoiceResult() must be called.


CanSwapMenu(NLua.LuaTable)

TODO


SwapMenu(NLua.LuaTable,NLua.LuaTable)

TODO


TributeMenu(System.Int32)

TODO


ShowMusicMenu(NLua.LuaTable)

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 recover the string representing the chosen song, UI:ChoiceResult() must be called.


Arguments

  • spoilerUnlocks: A lua table of strings representing progression flags that have been completed.
           Any ogg file that uses this tag as a spoiler tag will display in the menu only if the flag has been passed.

UI:DungeonChoice(System.String,RogueEssence.Dungeon.ZoneLoc)

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


Arguments

  • name: Name of the destination
  • dest: The ZoneLoc location of the destination.

UI:DestinationMenu(NLua.LuaTable,System.Object)

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 recover the ZoneLoc indicating the chosen destination, UI:ChoiceResult() must be called.


Arguments

  • destinations: A lua table representing the list of destinations with each element in the format of { Name=string, Dest=ZoneLoc }

UI:ServersMenu

TODO


UI:ContactsMenu

TODO


UI:SOSMenu

TODO


UI:AOKMenu

TODO


UI:PeersMenu

TODO


UI:ShowConnectMenu

TODO


UI:CurrentActivityMenu

TODO


UI:ChooseMonsterMenu(System.String,NLua.LuaTable,System.Boolean,System.Boolean,System.Int32)

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 recover the string indicating the chosen species, UI:ChoiceResult() must be called.


Arguments

  • title: The title of the menu
  • choices: A lua table of choices with each element being a MonsterID.
  • canMenu: If set to true, the Menu Button exits the menu if pressed.
  • canCancel: If set to true, the Cancel Button exits the menu if pressed.
  • slotsPerPage: Slots to display per page

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