escapewindow.swf
The Escape Window is the in-game pause/escape menu that appears when a player presses Escape in Trove. It presents navigation buttons for Instructions, Store, Settings, Mod Loader (or Exit Tutorial), and Exit, and supports console D-pad highlight/activate callbacks.
Document/main class: EscapeWindow (extends UIComponent)
SWF-specific classes: 3
Main class: EscapeWindow
EscapeWindow is the root document class for the escape/pause menu overlay. It extends _kiwi.Core.UIComponent. In its constructor it detects the console platform: if running on console, the Exit button is hidden (invisible and alpha 0) and the remaining three buttons (instructionsButton, storeButton, settingsButton) are shifted down by 30 pixels to fill the gap. configUI applies translation-key labels to all buttons and the window header, then registers four Iggy callbacks (highlightSelection, unhighlightSelection, activateSelection, setTutorial). They are not console-only in practice: the PC client sends highlightSelection(0) the moment the window opens, which puts the first entry (Instructions) on its over frame.
All button actions resolve through a single onButtonClicked handler that reads an enum value from __enum (populated by the game engine at runtime) and calls ON_BUTTON_CLICKED(uint) outward via ExternalInterface.
Public methods
EscapeWindow()— Constructor. Conditionally hides Exit button and offsets console buttons, then calls__setProp_winHeader_Scene1_header_0()to configure the window header component inspector properties.
Private / internal methods
configUI() : void— Overrides UIComponent. AttachesCLICKlisteners on all five buttons, assigns translation-key labels, sets the header text, callssetupTranslation(), and registers Iggy callbacks.onStageResized(param1:Number, param2:Number, param3:Number) : void— Overrides UIComponent. On console, callsESCAPE_WINDOW.CONFIGURED(consoleSelections.length)to notify the engine of the selection count after the stage is laid out.onButtonClicked(param1:MouseEvent) : void— Switch onparam1.targetto map each button to its enum value from__enum, then callsON_BUTTON_CLICKED(uint).highlightSelection(param1:uint) : *— Iggy callback. Sends the button atconsoleSelections[param1]to its"over"frame state.unhighlightSelection(param1:uint) : *— Iggy callback. Sends the button atconsoleSelections[param1]to its"up"frame state.activateSelection(param1:uint) : *— Iggy callback. Directly callsON_BUTTON_CLICKED(param1)bypassing the mouse event path, so its argument is the action value itself (an__enumvalue), not an index intoconsoleSelections.setTutorial(param1:Boolean) : void— Iggy callback. Whentrue, relabelsmodLoaderButtonto$EscapeMenu_ExitTutorial; whenfalse, restores$EscapeMenu_ModLoader. Only the label changes: the button still sends__enum.MODLOADER.
Key fields
winHeader : MovieClip— Custom window header; itswinTitleTextField.textis set to$EscapeMenu_Header.settingsButton : LabelButton— Opens the Settings panel; label$EscapeMenu_Settings.exitButton : LabelButton— Exits the game; label$EscapeMenu_Exit. Hidden (visible=false, alpha=0) on console.storeButton : LabelButton— Opens the Store; label$EscapeMenu_Store.instructionsButton : LabelButton— Opens the Instructions/tutorial; label$EscapeMenu_Instructions.modLoaderButton : LabelButton— Opens the Mod Loader, or exits the tutorial when in tutorial mode; label$EscapeMenu_ModLoader/$EscapeMenu_ExitTutorial.__enum : Object— Enum mapping object injected by the engine (keys:STORE,SETTINGS,EXIT,MODLOADER,INSTRUCTIONS). Populated at runtime; Flash reads it forON_BUTTON_CLICKEDvalues. Onlyescapewindow,inventoryandcharcustomizeuse an engine-filled__enumanywhere in the UI.consoleSelections : Array— Ordered list of buttons exposed to D-pad navigation on console ([instructionsButton, storeButton, settingsButton]).consoleButtonOffset : Number(const = 30) — Vertical pixel offset applied to console buttons to compensate for the hidden Exit button.
Frame scripts / timeline
No addFrameScript calls in EscapeWindow; the timeline has no scripted frames. The 386 × 346 stage (30 fps) has a single frame; besides winHeader and the five named buttons, its root holds an unnamed _kiwi.Controls.WindowCloseButton (depth 82) that the class never references — it is the window's ×, sending OnRequestClose and the Play_ui_window_close sound. Most of the file is an embedded Open Sans font. Individual button skins (BtnGreen, btnGreenIcon_small) use frame scripts internally to halt at each button state.
Runtime dependencies & integration
- Iggy / ExternalInterface callbacks registered:
highlightSelection,unhighlightSelection,activateSelection,setTutorial. - ExternalInterface calls out:
ON_BUTTON_CLICKED(uint),ESCAPE_WINDOW.CONFIGURED(uint);OnRequestClosecomes from the unnamed close button. - Translation keys:
$EscapeMenu_Instructions,$EscapeMenu_Store,$EscapeMenu_Settings,$EscapeMenu_Exit,$EscapeMenu_Header,$EscapeMenu_ModLoader,$EscapeMenu_ExitTutorial. - Platform checks:
IsConsole()(inherited global from UIComponent). - Kiwi controls used:
LabelButton(all five action buttons). onStageResizedoverride: firesESCAPE_WINDOW.CONFIGUREDso the engine knows how many selectable items exist for D-pad cycling.
Other game-specific classes
BtnGreen— ExtendsLabelButton; embedsassets.swfsymbol32. 4-state button skin (frames 1/2/3/4 eachstop()).btnGreenIcon_small— ExtendsLabelButton; embedsassets.swfsymbol11. Small icon-labelled green button skin, 4-state (frames 10/20/30/40 eachstop()).
Notable logic
- Engine-owned enum pattern: the
__enumobject is not defined in Flash; it is expected to be set on the component by the engine before any button is clicked. This lets the server-side code change the numeric identifiers for each menu action without recompiling the SWF. - Console layout shift: rather than having a separate console timeline frame, the constructor directly mutates
ypositions of the three console-visible buttons byconsoleButtonOffset(30 px) to fill the space vacated by the hidden Exit button. - D-pad navigation via index:
consoleSelectionsis an ordered array and the engine passes integer indices into it forhighlightSelection/unhighlightSelection, decoupling the game from specific button object references.activateSelectionis the exception: its argument is forwarded toON_BUTTON_CLICKEDuntouched. - Tutorial mode toggle: the
modLoaderButtondoubles as an "Exit Tutorial" button;setTutorial(true/false)swaps its label at runtime without any layout change, reusing the same button slot. onStageResizedhandshake: theESCAPE_WINDOW.CONFIGUREDcall inonStageResizedacts as a ready signal to the engine, passing the count of console-navigable selections so the engine knows the valid index range before it starts sending D-pad events.