Skip to main content

Textlistpopup

Based on game build 714014 | Last updated: 2026-03-09

Overview

TextListPopup is a screen class that displays a scrollable list of text entries in a popup window. It supports optional per-item click handlers (rendered as buttons), custom title/body text, and keyboard/controller navigation. Built as a subclass of Screen, it integrates into DST's UI flow and handles focus management for both mouse and controller inputs.

Usage example

local TextListPopup = require "screens/redux/textlistpopup"

local list_items = {
{ text = "Option 1", onclick = function() print("Clicked 1") end },
{ text = "Option 2", onclick = function() print("Clicked 2") end },
{ text = "No action" },
}

local popup = TextListPopup(list_items, "Title", "Description text goes here", nil, 10, false)
TheFrontEnd:PushScreen(popup)

Dependencies & tags

Components used: None identified
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
blackWidgetnilBackground tint widget added during construction.
prootWidgetnilMain root widget for popup content.
dialogCurlyWindownilContainer widget for title, body, and buttons.
scroll_listScrollingGridnilScrollable container for list items.
buttonstable{}List of button definitions (text, callback, controller control).
oncontrol_fnfunctionnilController input handler generated from buttons.
gethelptext_fnfunctionnilFunction returning help text string.

Main functions

OnControl(control, down)

  • Description: Handles input control events. Delegates to base screen and then to controller-specific button actions.
  • Parameters: control (string) — the control action (e.g., CONTROL_SELECT, CONTROL_CANCEL). down (boolean) — whether the control was pressed (true) or released (false).
  • Returns: true if the event was handled; false otherwise.

GetHelpText()

  • Description: Returns help text for the current UI state, typically used for on-screen controller prompt hints.
  • Parameters: None.
  • Returns: string — the help text.

_Cancel()

  • Description: Cancels and closes the popup by popping it from the frontend screen stack.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

None identified