MrxGuiAttractLayout
Module: mrxguiattractlayout.lua
Overview
The MrxGuiAttractLayout module defines the layout and initialization of a GUI attract mode screen. It sets up a widget list containing a main container with an image background, and provides functionality to reinitialize the GUI by removing and reloading widgets.
Inheritance
- Inherits from: none — base/utility module
- Imports:
MrxGuiAttractMode,MrxGuiBase
Instance pattern
This is a stateless manager/utility module. It does not track per-instance state but manages global GUI widget lists.
Functions
ReInit()
Reinitializes the GUI by removing all added widgets and reloading them from the local widget list. This function is used to refresh or reset the attract mode screen.
Events
This file has no Event.* references (no Event.Create, no engine event constants). The one “listener” here is a widget-layout EventHandlers table entry, visible directly in this file’s own LocalWidgetList[1] literal: EventHandlers = {GuiInitialization = MrxGuiAttractMode.HandleInit} (mirrored in EventHandlerNames = {GuiInitialization = "HandleInit"}). This is the GUI layout system’s own widget-event dispatch (triggered when the widget is loaded/added), not the engine Event.* system used elsewhere in resident/.
Widget geometry
"Attract"root: full-screen640×480containerwidget, white (255,255,255,255), center-anchored. Its one handler isGuiInitialization→MrxGuiAttractMode.HandleInit, which builds the actual letterboxedMovieWidgetat runtime."attract bg"child: full-screen640×480black (0,0,0,255) image, full UV, no handlers — the backdrop the attract movie plays over.
Notes for modders
- This file is pure layout data. All attract behavior (movie playback, input-to-shell transition) lives in
MrxGuiAttractMode; the movie playlist is its_tMoviestable, not anything here. ReInit()is a full teardown/rebuild of the widget tree (sameAddedWidgetList-must-pre-exist caveat as the other layout files).