MrxGuiLoadScreen
Module: mrxguiloadscreen.lua
Overview
The MrxGuiLoadScreen module is responsible for managing the loading screen GUI in the game. It handles the initialization, activation, and deactivation of the loading screen, as well as managing input events and animations related to saving icons.
Inheritance
- Inherits from: none — base/utility module
- Imports:
MrxGui,MrxGuiBase
Instance pattern
This is a stateless manager/utility module. It does not track per-instance state but manages the loading screen GUI globally.
Functions
HandleInit(oLoadScreen)
Initializes the loading screen by setting up its properties, adding a Flash widget for rendering, and initializing save icon elements. This function sets the loading screen to use immortal events, fullscreen mode, and adds event handlers for input and state changes.
InitSaveIcon()
Not previously documented — the “save icon elements” HandleInit calls out. Builds the save-icon widget tree: a container positioned at (64, 48) sized by _knSaveIconSize, with a child image widget inside it, and two animation points (nOpenPoint/nClosePoint) recording the icon’s on/off-screen X positions for HandleSaveIconShow/HandleSaveIconHide to animate between.
HandleStateChangeEvent(oLoadScreen, tData)
Handles state change events by activating or deactivating the loading screen based on the bLoading flag in the event data.
_SetActive(oLoadScreen, bActive)
Sets the active state of the loading screen. If the screen is being deactivated, it calls a Flash action script callback to close the loading screen and resets various flags. If the screen is being activated, it loads the Flash file if not already loaded and sets up the necessary properties.
_CompleteFlashLoad(oLoadScreen)
Completes the loading of the Flash file by setting the bFlashLoaded flag and obtaining control focus for the loading screen.
HandleInput(oLoadScreen, tInput)
Handles input events by updating the analog input state and calling appropriate Flash action script callbacks to handle left analog stick movement.
IsAnalog(nValue)
Checks if a given value corresponds to an analog controller input.
_SaveIconAnimationComplete(oIcon)
Handles the completion of the save icon animation by reversing the texture coordinates and restarting the animation.
HandleSaveIconShow(oContainer, tEvent)
Shows the save icon by setting its visibility and starting the animation sequence.
HandleSaveIconHide(oContainer, tEvent)
Hides the save icon by resetting its animation state and hiding it from view.
Events
No Event.*/Event.Create(...) engine-event references appear in this file — confirmed by grep. All wiring uses widget-level SetEventHandler (string keys), three confirmed sites:
"ControllerInput"→HandleInput(registered on the load-screen widget inHandleInit) — handles left-analog passthrough to the Flash file and tessellation-toggle bookkeeping vianAnalogInputHeld."ShowSaveIcon"→HandleSaveIconShowand"HideSaveIcon"→HandleSaveIconHide(registered on the save-icon container inInitSaveIcon).
HandleInit and HandleStateChangeEvent are not registered by SetEventHandler anywhere in this file — they are wired externally via mrxguiloadlayout.lua’s LocalWidgetList, which sets the root “Loading Screen” widget’s EventHandlers.GuiInitialization = MrxGuiLoadScreen.HandleInit and EventHandlers.LoadStateChange = MrxGuiLoadScreen.HandleStateChangeEvent.
Module constants & tunables
_gLoadFlashFile = "loadingscreen"— the Scaleform.gfxmovie loaded as the loading screen. Swap this for a different file name to replace the whole loading-screen visual (_SetActiveloads it lazily on activate).- Save-icon texture:
"global_loading_skull"— the spinning skull shown while saving (InitSaveIcon). - Save-icon label:
"[SHELL.LoadSave.Saving]"(localization key) in font"english_18", positioned right of the icon. _knSaveIconSize = 64(px) and_knSaveIconTime = 0.5(seconds per open/close animation leg) — the save-icon geometry and animation speed. The icon container sits at(64, 48).- Flash ActionScript callbacks this module calls:
"closeLoadingScreen"(on deactivate) and"leftAnalog"(analog-stick passthrough, with{nX, nY}). These are the.gfx-side entry points. - Analog detection range (
IsAnalog): joystick button indices betweenBUTTON_L_STICK_LandBUTTON_R_STICK_D(9–16) count as analog input.
Notes for modders
- Replace the loading-screen visual by pointing
_gLoadFlashFileat a different.gfx— everything else (activation, control focus, analog passthrough) keeps working around whatever file you load. - The save icon “flips” by swapping its texture U coordinates each animation cycle (
_SaveIconAnimationComplete), so a symmetric skull texture looks like it’s continuously spinning; a non-symmetric replacement will visibly mirror.