Skip to main content

Genericwaitingpopup

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

Overview

GenericWaitingPopup is a UI screen component that presents a simple animated waiting dialog to the user. It displays a customizable title and a dynamically growing ellipsis (".", "..", ..., up to six dots) to indicate ongoing activity. It optionally supports an "OK" or "Cancel" button and responds to controller keyboard/input events for cancellation. The screen is built using Redux UI templates and inherits from the base Screen class.

Usage example

local GenericWaitingPopup = require "screens/redux/genericwaitingpopup"

local popup = GenericWaitingPopup(
"loadingpopup",
STRINGS.UI.LOADING.TITLE,
{ { text = "Retry", cb = function() print("Retry") end } },
false, -- allow cancel
function() print("Cancelled") end
)

TheFrontEnd:PushScreen(popup)

Dependencies & tags

Components used: None identified.
Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
forbid_cancelbooleanfalseIf true, disables the cancel button and input handling.
cancel_cbfunction or nilnilCallback function executed when the user cancels.
buttonstable{}List of button definitions added to the popup.
dialogwidget (CurlyWindow)nilRoot dialog widget containing title and body.
default_focuswidgetdialogWidget set as the default focus target.
timenumber0Accumulated time (in seconds) since last ellipsis update.
progressnumber0Current ellipsis length (1–6), cycling repeatedly.

Main functions

OnUpdate(dt)

  • Description: Updates the ellipsis animation. Increments the ellipsis length every 0.75 seconds, cycling from 1 to 6 dots and repeating. Updates the body text of the dialog with the current ellipsis.
  • Parameters: dt (number) — delta time in seconds since the last frame.
  • Returns: Nothing.

OnControl(control, down)

  • Description: Handles input controls. Delegates to the parent Screen implementation, then checks for the CONTROL_CANCEL input to trigger cancellation if not forbidden.
  • Parameters:
    • control (enum) — the control key pressed (e.g., CONTROL_CANCEL).
    • down (boolean) — true when the control is pressed, false when released.
  • Returns: true if the event was handled by this component or parent; false otherwise.

OnCancel()

  • Description: Executes the user-defined cancel callback (if provided), disables the screen, and removes it from the front-end stack.
  • Parameters: None.
  • Returns: Nothing.

Close()

  • Description: Alias for OnCancel(). Invokes cancel behavior to close the popup.
  • Parameters: None.
  • Returns: Nothing.

GetHelpText()

  • Description: Returns localized help text for input controls. Only includes cancel help if forbid_cancel is false.
  • Parameters: None.
  • Returns: string — localized help text for the current input mode.

Events & listeners

None identified.