Skip to main content

Networkloginpopup

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

Overview

NetworkLoginPopup is a UI screen component that presents a modal dialog during network login attempts. It provides visual feedback (via an animated ellipsis) while waiting for the account manager to respond and offers the user options to proceed offline or cancel the login. It extends Screen and integrates with the TheFrontEnd and TheInventory systems to monitor login progress and handle user input.

Usage example

local NetworkLoginPopup = require "screens/networkloginpopup"

TheFrontEnd:PushScreen(NetworkLoginPopup(
function(forceOffline)
-- called on login success or offline fallback
print("Login completed, offline:", forceOffline)
end,
function()
-- called when user cancels
print("Login cancelled")
end,
false -- show offline button
))

Dependencies & tags

Components used: TheFrontEnd, TheInventory, TheFrontEnd:GetAccountManager(), TheInventory:IsDownloadingInventory()
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
blackImageFullscreen dark overlay for focus.
prootWidgetRoot widget container for proportional scaling.
bgWidget (from template)Background container (curly window).
titleTextempty stringTitle text (currently unused, always empty).
textTextSTRINGS.UI.NOTIFICATION.LOGINDynamic status text with animated ellipsis.
menuMenuContainer for action buttons.
buttonstableList of button configs (text + callback).
default_focusMenuSets menu as default input focus.
timenumber0Accumulator for ellipsis animation timing.
progressnumber0Current ellipsis step (1–3).
onLoginfunctionCallback invoked on login completion or offline fallback.
onCancelfunctionCallback invoked on user cancellation.
loggedbooleanfalseInternal flag indicating login has been handled.

Main functions

OnUpdate(dt)

  • Description: Updates the ellipsis animation and checks login state; automatically completes login if no longer waiting or downloading.
  • Parameters: dt (number) — time elapsed since last frame.
  • Returns: Nothing.
  • Error states: None. Progress animation resets after progress > 3.

OnControl(control, down)

  • Description: Handles user input, particularly CONTROL_CANCEL to trigger cancellation. Delegates base screen input handling first.
  • Parameters:
  • control (string) — the control key pressed.
  • down (boolean) — whether the control is pressed (true) or released (false).
  • Returns: true if input was consumed, otherwise false.
  • Error states: Only triggers OnCancel() on release of CONTROL_CANCEL (down == false).

OnLogin(forceOffline)

  • Description: Finalizes the login process, disabling the screen and invoking the onLogin callback. Supports optional offline mode.
  • Parameters: forceOffline (boolean, optional) — if true, explicitly cancels online login and proceeds offline.
  • Returns: Nothing.
  • Error states: If logged is already true, the function returns early without side effects.

OnCancel()

  • Description: Cancels the active login attempt, discards the screen, and invokes the onCancel callback.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: Ensures CancelLogin() is called on the account manager and the screen is popped from the frontend stack.

Events & listeners

  • Listens to: CONTROL_CANCEL — triggers OnCancel() when released.
  • Pushes: None identified.