Skip to main content

Networkloginpopup

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

Overview

NetworkLoginPopup is a UI screen component that inherits from GenericWaitingPopup and provides a modal dialog during the account login and inventory download process. It monitors the account manager's login state and the inventory system's download progress, updating the dialog title to reflect the current step on console platforms. It manages callback execution for successful login or cancellation and cancels ongoing operations on exit.

Usage example

local NetworkLoginPopup = require "screens/redux/networkloginpopup"

local popup = NetworkLoginPopup(
function(forceOffline)
-- Handle successful login (forceOffline = true if offline play selected)
end,
function()
-- Handle cancelled login
end,
false -- hideOfflineButton
)
TheFrontEnd:PushScreen(popup)

Dependencies & tags

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

Properties

PropertyTypeDefault ValueDescription
onLogin_cbfunctionnilCallback invoked on successful login or offline fallback. Receives forceOffline boolean argument.
onCancel_cbfunctionnilCallback invoked when user cancels the login process.
inventory_stepnumberINVENTORY_PROGRESS.IDLETracks the last displayed inventory progress step (console only).
loggedbooleanfalseInternal flag indicating whether login has already been processed.

Main functions

:OnUpdate(dt)

  • Description: Updates the popup state each frame. Monitors login status and inventory download progress, updating the dialog title on console platforms to reflect the current step (e.g., CHECK_SHOP, CHECK_INVENTORY). Automatically triggers OnLogin() when login completes and inventory download finishes.
  • Parameters: dt (number) - Delta time since last frame.
  • Returns: Nothing.

:OnLogin(forceOffline)

  • Description: Finalizes the login process. Disables the popup, stops updates, cancels pending operations if forceOffline is true, and invokes the onLogin_cb callback.
  • Parameters: forceOffline (boolean, optional) - If true, cancels network login and inventory download to allow offline play.
  • Returns: Nothing.
  • Error states: Executes only once; subsequent calls are ignored due to self.logged guard.

:OnCancel()

  • Description: Handles user cancellation. Disables the popup, cancels network login and inventory download, pops the current screen, and invokes the onCancel_cb callback.
  • Parameters: None.
  • Returns: Nothing.

Events & listeners

  • Listens to: None identified.
  • Pushes: None identified.