Guide:Simple Popup Message

From Starbounder - Starbound Wiki
Jump to: navigation, search
Mining Hazard Sign.png
Work In Progress!
Mining Hazard Sign.png

This article or section is currently in the process of an expansion or major restructuring.
You are welcome to assist in its construction by editing it as well.

Last edited by A Starbounder Wiki Editor on 2024-08-23 01:46:53.

Displaying a popup message on the player's screen is an easy UI action to execute. If you are interested in displaying a more customizable UI, see this article.

Code

player.interact("ShowPopup", {message = "Test successful!"})

InteractActions

The player.interact() function triggers an interactAction through the client's player. Interactions done with the function are related to UI actions, including hardcoded UI triggers that can be accessed with the specified action (OpenTeleportDialog prompts the teleportation UI).

UI Actions

Refer here for the listed UI actions: Modding:Lua/Hooks/Object

Json Parameters

The message argument is part of the optional json parameters. These json parameters are defined in the UI's config file, allowing flexibility without heavy scripting involved.

Trivia

The "ShowPopup" ui is a leftover from the beta development builds. Before their removal, these popups were commonly associated with consumable items that unlocked a new section of the game. Fragments of these items remain in the files as ".unlock" items, although some lacked the popup functionality they originally had (such the shipT items)