hotbar.swf
The persistent bottom-of-screen HUD shown during gameplay in Trove. It renders the player's quick-slot items, health and energy globes, fuel/radiance gauge, and Bard-specific UI elements (song meter, melody level pips, QTE prompts). It switches between four distinct layout modes — adventure, build, pvp, and discovery — each with its own slot arrangement and globe configuration.
Document/main class: Hotbar (extends UIComponent)
SWF-specific classes: 24 (excluding framework)
Main class: Hotbar
Hotbar is the root UIComponent that owns all four mode sub-MovieClips and delegates to them based on the active game mode. It is responsible for:
- Initialising all four mode layouts (
adventure,build,pvp,discovery) at construction time, hiding all but the default (adventure). - Configuring
Globeinstances per mode: standard square-mask fill for adventure/build/pvp; arc-mask fill with specific rotation/arcSize constants for discovery. - Registering all
ExternalInterfacecallbacks that the C++ game engine calls to drive the UI. - Delegating drag-drop hit-testing to
SlotDragDropHelper.
Constructor flow:
- Sets
hotbarModesarray (["adventure","build","pvp","discovery"]). - Calls
addFrameScript(0, frame1)which stops the timeline. - Iterates all modes, hides selectors, configures globe arc/mask parameters for discovery vs. normal modes.
- Hides
pvp.spectateControls; routes it to either"Console"or"PC"frame. - Hides
fuel. - Registers
SlotDragDropHelper.registerDropCallback(onDrop). - If running in Iggy (
IggyFunctions.inIggy == true): registers allExternalInterfacecallbacks. - If NOT in Iggy (local test mode): switches to discovery mode, fills globes to 100%, queues test messages, and starts
ENTER_FRAMEfor animated health drain simulation.
Public methods
setSlotState(param1:int, param2:int) : void— Configures a single slot at indexparam1within the current mode. Sets the slot'sdatato its index (0–7), which is the value the slot's ownSLOT.*calls hand the engine to name the quickslot. Sets slot size (51 px square / 60 px circle), advancesequippedBorderandslotFrameto"square"or"circle"labels, togglesBGandgoldFramevisibility.goldFrameis hidden in discovery mode regardless of shape.
Private methods (ExternalInterface callbacks)
setMode(param1:String) : *— Shows the matching mode MovieClip, hides the rest. Recalculates how many slots are square vs. circle per mode:- adventure / pvp: slots 0–5 square, slots 6–7 circle.
- discovery: slots 0–4 square, slots 5–7 circle.
- build: all 8 circle (no square slots); globe frame goes to stop 2.
Sets
globeFramestop for non-discovery modes (1 for adventure/pvp, 2 for build).
toggleEquipQuickslot() : void— Toggles visibility of the current mode'sselectorMovieClip.moveSelector(param1:int) : void— Repositionsselector.xto align with slotparam1.confirmEquip(param1:int, param2:uint, param3:Number) : *— Verifies a slot exists then callsExternalInterface.call("HOTBAR.DROP_ONTO_SLOT", ...).adjustSlotForHotkeySize(param1:int, param2:Boolean) : void— NudgeshotkeyTextField(and optionally the slot itself) by_xTranslate/_yTranslateoffset constants (7/4 px) to compensate for a wide hotkey label. Tracks position state withtranslatedHotkeyPositionandtranslatedSlotPositionflags on the slot.setBardSongState(param1:Boolean) : *— Shows/hidesbardSongFilling,bardSongOutline, andQTE; resets song and melody state when hiding.setBardSongValue(param1:Number) : *— SetsbardSongFilling.scaleXtoclamp(|current / max|, 0, 1).setBardSongMax(param1:Number) : *— UpdatesbardSongMax.setBardMelodyLevel(param1:int) : *— Shows Melody1–Melody11 sub-clips onbardSongOutlineusing fall-through switch (cumulative visibility up to the given level).setBardQTE(param1:int) : *— Shows one of four QTE sub-clips by index (0BasicAttack,1Dodge,2NimbleDance,3SingingCrystal) and callsQTE.gotoAndPlay(0)when a new non-negative index is set. It makesQTEvisible on its own, whateversetBardSongStatelast said.setFuelType(param1:int) : *— Delegates tofuel.fuelType. In practice this is Solarion's radiance; no other fuel type has art.setFuel(param1:int) : *— Delegates tofuel.amount.onDrop(x, y, ..., typeId, amount) : *— Hit-tests all slots in current mode; on match callsExternalInterface.call("HOTBAR.DROP_ONTO_SLOT", slotIndex, typeId, amount).localTestEnterFrame(param1:Event) : void— Local-only test animation: slowly drains then refills the discovery health globe, with accelerated drain spikes near 80% and 60%.
Key fields
currentMode : String— Tracks which of the four modes is active (default:"adventure").hotbarModes : Array— Ordered list["adventure","build","pvp","discovery"]used for iteration.adventure, build, pvp, discovery : MovieClip— The four mode-layout sub-clips (instances of their respectiveHotbar_fla/*Mode_*classes).fuel : Fuel— The fuel/radiance gauge component (initially hidden).bardSongOutline : MovieClip— Outline container holding Melody1–Melody11 sub-clips.bardSongFilling : MovieClip— Horizontally scaled fill bar for bard song charge;scaleXdriven bysetBardSongValue.bardSongMax : Number— Maximum song charge value (default 50).bardSongCurrent : Number— Current song charge value.bardMelodyLevelCurrent : int— Current melody level (0–11).QTE : MovieClip— Container for Quick-Time Event prompts (maps toHotbar_fla.QTE_61); holdsBasicAttack,Dodge,NimbleDance,SingingCrystalsub-clips.currentQTE : int— Last QTE index set; deduplicates redundant updates (default -1 = none).messageQueue : MessageQueue— The in-game notification queue component;addMessagestrings carry the engine's own markup and are shown throughhtmlText._xTranslate / _yTranslate : Number— Pixel offsets (7, 4) for hotkey label repositioning.degen : Boolean— Direction flag for local test health-drain animation.
Frame scripts / timeline
frame1()— Callsstop().
Runtime dependencies & integration
Iggy / ExternalInterface callbacks registered (C++ → Flash):
| Callback name | Handler |
|---|---|
setMode |
setMode(String) |
addMessage |
messageQueue.addMessage |
TOGGLE_EQUIP_QUICKSLOT |
toggleEquipQuickslot() |
MOVE_SELECTOR |
moveSelector(int) |
CONFIRM_EQUIP |
confirmEquip(int, uint, Number) |
ADJUST_SLOT_FOR_HOTKEY_SIZE |
adjustSlotForHotkeySize(int, Boolean) |
SET_BARD_SONG_STATE |
setBardSongState(Boolean) |
SET_BARD_SONG_VALUE |
setBardSongValue(Number) |
SET_BARD_SONG_MAX |
setBardSongMax(Number) |
SET_BARD_MELODY_LEVEL |
setBardMelodyLevel(int) |
SET_BARD_QTE |
setBardQTE(int) |
SET_FUEL_TYPE |
setFuelType(int) |
SET_FUEL |
setFuel(int) |
Direct property writes (C++ → Flash): the callbacks above do not carry quickslot contents or health/energy. The engine writes those straight onto the timeline objects by path, e.g. adventure.slot_3.iconImage and adventure.health.globe.percent, into whichever of the four mode clips it chooses, visible or not. On each Globe it writes percent and amount and nothing else; amount is written on PC too, even though amountText only exists on the console frames, and health reaches the millions at high Power Rank. A class with no energy gets no energy write at all for the whole session (not a zero). On each filled slot it writes tooltipName / tooltipDescription, which the slot's TOOLTIP.SHOW sends back; it also sets selector.visible itself. Slot and ability icons arrive through the objectPreviewReady handshake.
ExternalInterface calls (Flash → C++):
| Call | Triggered by |
|---|---|
HOTBAR.DROP_ONTO_SLOT(slotIndex, typeId, amount) |
Drag-drop hit (onDrop) or confirmEquip |
The shared slot class adds SLOT.ACTIVATE, SLOT.DRAG_START, SLOT.POINTER_ENTER / SLOT.POINTER_LEAVE (each naming the slot by its data index) and TOOLTIP.SHOW / TOOLTIP.HIDE.
Placement: the engine places the 785×108 box centred horizontally and flush with the bottom of the screen.
Events listened:
Event.ENTER_FRAMEon self — local test mode only.Event.ENTER_FRAMEon eachGlobeinstance — Console layout, deferred hide ofamountText.
Framework hooks:
SlotDragDropHelper.registerDropCallback(onDrop)— receives global drag-drop events.IggyFunctions.inIggy— runtime flag used to branch between Iggy and local test paths.IsConsole()— global function used inHotbar(for spectateControls frame),Globe(ENTER_FRAME branch), andslot/mode classes (Console timeline branch).
Other game-specific classes
Top-level game classes
-
Globe(extendsUIComponent, embed symbol77) — Health or energy fill widget. Supports two display modes: square-mask (vertical fill usingsquare_maskheight), and arc-mask (usingArcMaskfor the circular discovery UI). Features IggyTween-driven pulse animation below a configurablelowPercentThreshold(usingColorMatrixFilterbrightness overlay), and an optional "chunk" drain animation (darkens content during deferred arc retraction over 5 seconds). Draws a glowing highlight line at the arc's leading edge usingGraphicsAPI andGlowFilter. UsesKiwiTextUtil.addDigitDelimitersfor numeric amount display. TwoIggyTweeninstances (pulseAnimation,chunkAnimation) are managed internally. -
Fuel(extendsUIComponent, embed symbol143) — Container for the fuel gauge. Currently only handlesfuelType == 15(Radiance type), delegating to a nestedradiance : MovieClipsub-component. Hidden when fuel type is 0. ExposesfuelTypeandamountsetters. -
Radiance(extendsUIComponent, embed symbol142) — Displays the Radiance resource bar. Contains abarMovieClip (a 51-frame timeline,gotoAndStop(amount)) and seven directional arrow MovieClips (arrow1–arrow7).UpdateArrowsanimates pairs of arrows (arrow2/3 at threshold 10, arrow4/5 at 17, arrow6/7 at 24) by playing/stopping based on whether the value crosses those thresholds. -
slot(extends_kiwi.Controls.Slot, embed symbol116) — Standard quickslot widget. Frame 1 stops; frame 11 (Console branch) stops and tellsquantityBadgeto play from"Console". -
slotDiscovery(extends_kiwi.Controls.Slot, embed symbol122) — Identical in structure toslot; used for the circular discovery slots (0–4 in discovery mode). -
messageQueue(extends_kiwi.Controls.MessageQueue, embed symbol46) — Asset-embed wrapper for the notification queue; no additional logic. -
meterHealthMC(extendsGlobe, embed symbol32) — Asset-embed wrapper for the health globe symbol; no additional logic. -
meterEnergy(extendsGlobe, embed symbol37) — Asset-embed wrapper for the energy globe symbol; no additional logic. -
FuelGauge(extendsMovieClip, embed symbol39) — Bare asset-embed wrapper; no logic. -
HomeButton(extendsUIComponent, embed symbol44) — Bare asset-embed wrapper; no logic. -
hotbar_bg(extendsUIComponent, embed symbol49) — Bare asset-embed wrapper for the background graphic; no logic.
Hotbar_fla timeline symbol classes
-
adventureMode_45(embed symbol170) — Adventure mode layout MovieClip. Holdsslot_0–slot_7(slot),health,energy,selector. Console branch (frames 11 and 20) triggersgotoAndPlay("Console")on all child slots and globes. -
buildMode_43(embed symbol166) — Build mode layout. Same slot/globe structure as adventure. Console branch (frame 12) triggersgotoAndPlay("Console")on children. -
pvpMode_33(embed symbol165) — PVP mode layout. Holdsslot_0–slot_5,health,energy,selector, andspectateControls(a MovieClip routed to"PC"or"Console"frame byHotbar). Two timeline frames (PC / Console). -
discoveryMode_9(embed symbol147) — Discovery mode layout. Slots 0–4 areslotDiscovery; slots 5–7 are standardslot. Containshealth,energy,selector. All slots initialised withclickFeedback = false. -
globeWithMask_36(embed symbol164) — Wrapper MovieClip holding aGlobechild reference. Console frame (frame 11) triggersglobe.gotoAndPlay("Console"). -
QTE_61(embed symbol223) — QTE prompt container. HoldsBasicAttack,Dodge,NimbleDance,SingingCrystalsub-clips. Plays a 48-frame animation when a QTE starts; frame 48 stops playback. -
slotFrame_11(embed symbol82) — Visual frame around a slot; three-state timeline: frames 1/11/21 each stop, labelled"circle","largeCircle"and"square". -
qualityPips_12(embed symbol89) — Item quality pip display; stops on frame 1. -
equipped_14(embed symbol97) — The slot'sequippedBorder: two-frame clip (frames 1 and 2 both stop) labelled"square"and"circle", the border shapesetSlotStateselects for the slot. -
slotQuantity_22(embed symbol113) — Quantity badge containing aTextField; two-frame PC/Console layout. -
globeFrame_42(embed symbol75) — Globe decorative frame; two-frame stop, unlabelled.Hotbar.setModesends it to frame 1 in adventure/pvp and frame 2 in build, and leaves it alone in discovery. -
radiance_bar_3(embed symbol134) — Radiance bar fill clip; stops on frame 1. -
radiance_arrow_anim_6(embed symbol141) — Single radiance arrow animation; plays 8 frames then stops. -
spectateControls_35(embed symbol161) — Spectate control overlay for PVP; two-frame PC/Console layout. -
bg_fill_large_39(embed symbol59) — Globe background fill animation with halting frames at 10, 20, 30 (three animated variants). -
edgeBar_40(embed symbol66) — Globe liquid-edge animation with identical halt structure tobg_fill_large_39(frames 10, 20, 30).
Asset wrappers (bitmap/shape embeds — not individually detailed)
10 classes: rarity_frame_common_png, rarity_frame_uncommon_png, rarity_frame_rare_png, rarity_frame_epic_png, rarity_frame_legendary_png, rarity_frame_relic_png, rarity_frame_shadow_png, rarity_frame_resplendent_png, rarity_frame_radiant1_png, rarity_frame_normal_over_png — all extend BitmapData, embedding /_assets/*.png. Also: rarity_frame_stellar (extends BitmapData, embeds /_assets/10_rarity_frame_stellar.png), dummy (extends BitmapData, embeds /_assets/99_dummy.png, 52×52). Radiance projectile symbols: radiance_projectile_4, radiance_projectile_a, radiance_projectile_b, radiance_projectile_c, radiance_projectile_d — all extend MovieClip, bare embed wrappers. Total asset-wrapper classes: 17.
Notable logic
-
Mode switching and slot shape:
setModedrives both layout visibility and slot shape assignment. Adventure/PVP use 6 square + 2 circle slots; discovery uses 5 square + 3 circle; build uses 0 square + 8 circle. ThegoldFrameoverlay is explicitly suppressed in discovery mode. -
Arc-mask globes (discovery mode): The discovery health globe uses
arcSize = 348.5°(nearly full circle), rotation−106.5°, and fixed inner/outer radii of 38–54 px. The energy globe uses a narrower arc of145°, rotation−287°, and tapered radii (70.5–75.8 px outer, 54.5–75.4 px inner). These are hardcoded in Hotbar's constructor using degree-to-radian conversion. -
Chunk drain animation: When health or energy drops by more than 5% in one update (
CHUNK_THRESHOLD) anduseChunkAnimationsis true (discovery health only), the old fill level is retained as a darkened "ghost" that animates down to the new level over 5 seconds at 2 units/second viaIggyTween. During this,content.filtersis set to a darkColorMatrixFilter (−160 brightness). -
Low-health pulse: When
percent < lowPercentThreshold, the globe overlays a brightening filter (+200 brightness) and starts anIggyTweenping-pong (pulseIn/pulseOut) cycling at 0.2 s per leg until the percentage rises above the threshold again. -
Bard melody level:
setBardMelodyLeveluses an intentional fall-through switch (nobreakstatements) so setting level 5 makes Melody1–Melody5 all visible simultaneously. -
Hotkey label nudge:
adjustSlotForHotkeySizedistinguishes between square slots (BG visible) — which only shift the text field — and circle slots — which shift both the slot container and the text field in opposite directions, effectively centering the label differently for each shape. -
Console vs PC branching:
IsConsole()is called at multiple levels.spectateControlsswitches its layout frame on init. Mode MovieClips have a dedicated "Console" timeline label thatgotoAndPlays child globes and slots into their Console variants.Globeadditionally usesENTER_FRAMEon Console to defer hidingamountTextuntil the Console layout frame has rendered.