starbar.swf
The Star Bar is a persistent HUD element that displays up to three stacked progress bars (the once-a-day Star Bar, the Tome Bar and the Auto-Use Bar) plus up to two Reliquary "mega" items. It supports two display modes — Normal (in the world) and Discovery/Geode (in the Geode caves) — reports its height so the engine can stack the quest tracker below it, and plays its own reward animation and sound when a star bar fills.
Document/main class: StarBar (extends UIComponent)
SWF-specific classes: 12
Main class: StarBar
StarBar extends _kiwi.Core.UIComponent and is the root document class. The constructor initialises six progress-bar references into two parallel arrays (normalProgressBars for Trove and discoveryProgressBars for Geode mode), snapshots each bar's initial Y position for later layout reflow, and sets localisation-key tooltip strings (UITooltipTitle / UITooltipDescription) on the three normal bars. It then registers Iggy callbacks (when running inside the game engine) or populates mock test data (when running outside Iggy).
addFrameScript(0, frame1) stops the timeline on frame 1 (label PC, idle). Frame 11 carries the root's Console label, which UIComponent's constructor jumps to when IsConsole() (Xbox One / PS4 platform); frame11 stops there and switches both starProgressBar and tomeProgressBar to their own Console labels.
Data arrives from the engine through the nine ExternalInterface callbacks and through direct property writes on the two reliquary items (mega0, mega1). StarBar itself makes one outbound call (NOTIFY_RESIZED) when the total bar height changes; the tooltip and reward-sound calls come from the bars.
Public methods
setAutoUseIcon(textureName:String) : void— sets the texture on the two auto-useObjectPreviewicons and adds each to its bar'sbarIcon.autoUseDisplay, sized 40×40 (normal) / 30×30 (geode).setNewProgressPercent(barIndex:int, percent:Number) : void— sets the total progress fraction (0–1, clamped: the settled progress plus what has just been earned, not the increment) on barbarIndexin both normal and geode arrays. Reaching 1 with no animation pending also sets the filled fraction to 1; a star bar then plays its reward animation and sound, while the tome and auto-use bars showcompleteMC.setFilledPercent(barIndex:int, percent:Number) : void— sets the settled (baseline) fraction, 0–1 clamped, for barbarIndexin both arrays.setRewardAmount(barIndex:int, amount:int) : void— updates the numeric reward label on barbarIndexin both arrays.setRewardImage(barIndex:int, imageName:String) : void— sets the reward icon texture on barbarIndexin both arrays.setDisplayMode(mode:int) : *— setsm_mode(0 = Normal, in the world; 1 = Discovery/Geode, in the Geode caves). Visibility of individual bars is governed by subsequentsetVisiblecalls;UpdateHeightmust be called to reflow.UpdateHeight() : *— repositions visible bars by stacking them using their saved Y positions array; repositions mega bars below; recalculates total component height (48 + visibleCount * 40 + (megaVisible ? 88 : 0)) and callsExternalInterface.call("NOTIFY_RESIZED", 374, this.height)when height changes.UIComponent.heightis a stored size, so the reported height is this formula, not the clip's drawn bounds.setMegaVisible(index:int, visible:Boolean) : void— shows or hides aReliquaryItemmega slot and, only when that changes its visibility, triggersUpdateHeight.setVisible(barIndex:int, visible:Boolean) : void— shows or hides barbarIndexin the active mode's array (only the active mode's bar is shown), then triggersUpdateHeighton every call.isWaitingOnAnimation(barIndex:int) : Boolean— returns whether barbarIndexin the active mode is blocked on a completion animation, so the engine can defer further progress updates. Only the star bars have arewardAnimation, so this is never true for indices 1 and 2; it returns false for any mode other than 0 or 1.
Key fields
normalProgressBars : Array—[starProgressBar, tomeProgressBar, autoUseTomeProgressBar]; used whenm_mode == 0.discoveryProgressBars : Array—[geodeStarProgressBar, geodeTomeProgressBar, geodeAutoUseTomeProgressBar]; used whenm_mode == 1.megaProgressBars : Array—[mega0, mega1];ReliquaryIteminstances shown below the stacked bars.normalProgressBarPositionsY : Array— snapshot of each normal bar's initial Y, used for layout reflow.discoveryProgressBarPositionsY : Array— snapshot of each geode bar's initial Y.megaProgressBarPositionY : int— baseline Y for both mega slots.m_mode : int— 0 = Normal, 1 = Discovery/Geode; gates which bar array is visible.autoUseIcon : ObjectPreview— 30×30 icon for the normal auto-use bar.geodeAutoUseIcon : ObjectPreview— 20×20 icon for the geode auto-use bar.starProgressBar,tomeProgressBar,autoUseTomeProgressBar:UIComponent— the three normal-mode bar instances on the timeline; tooltip keys$StarBar_Tooltip_*,$TomeBar_Tooltip_*,$AutoUseBar_Tooltip_*are set in the constructor.geodeStarProgressBar,geodeTomeProgressBar,geodeAutoUseTomeProgressBar:UIComponent— geode-mode bar instances.mega0,mega1:ReliquaryItem— mega reward display slots; the engine writes theirfillandiconImagedirectly by instance name.
Frame scripts / timeline
frame1()—stop(). Default idle state.frame11()—stop()then callsgotoAndPlay("Console")on bothstarProgressBarandtomeProgressBarto activate their console visual variants.
Runtime dependencies & integration
Iggy callbacks registered (engine → Flash):
setNewProgressPercent(barIndex, percent)setFilledPercent(barIndex, percent)setRewardAmount(barIndex, amount)setRewardImage(barIndex, imageName)isWaitingOnAnimation(barIndex)→ BooleansetVisible(barIndex, visible)setDisplayMode(mode)setMegaVisible(index, visible)setAutoUseIcon(textureName)
barIndex is 0 = star, 1 = tome, 2 = auto-use tome (the order of normalProgressBars / discoveryProgressBars); the bars are addressed by nothing else. setMegaVisible's index selects mega0 / mega1.
Engine property writes (no callback): the engine sets fill (0–1) and iconImage (texture) directly on the root's mega0 and mega1 ReliquaryItem instances, and keeps rewriting fill as reliquary progress changes. setMegaVisible only shows and hides them.
ExternalInterface outbound calls (Flash → engine):
"NOTIFY_RESIZED"with fixed width374and computed height — called fromUpdateHeightwhenever the bar stack height changes. The engine treats the reported height as the strip's footprint:questtracker.swfis stacked directly below it, and the SWF is not scaled to the reported size."UIComponent.OnShowTooltip"(stageX, stageY, title, description)/"UIComponent.OnHideTooltip"— the keyed tooltip comes fromUIComponent'sROLL_OVER/ROLL_OUThandlers, which theUITooltipTitlesetter attaches, so only the three normal bars send$…_Tooltip_*keys.ProgressBaralso sends the pair from its ownMOUSE_OVER/ROLL_OUT/MOUSE_LEAVElisteners, passingtooltipName/tooltipDescription, which nothing in this SWF sets."POST_SOUND_EVENT", "Play_ui_starbar_reward"— called byProgressBarwhen a bar reaches 100% and its reward animation begins; only the two star bars have one.
Tooltip localisation keys: $StarBar_Tooltip_Title, $StarBar_Tooltip_Description, $TomeBar_Tooltip_Title, $TomeBar_Tooltip_Description, $AutoUseBar_Tooltip_Title, $AutoUseBar_Tooltip_Description. English titles are "Star Bar", "Tome Bar" and "Auto-Use Bar"; the descriptions say the Star Bar can be filled once per day for Cubits and Flux, with stars earned in dungeons, and that the Tome and Auto-Use bars charge in Dungeons, Geode Caves and Delves.
Other game-specific classes
ProgressBar— baseUIComponentfor all six progress bars. ManagesfilledPercent(baseline fill),newProgressPercent(target fill including new progress),rewardAmount(numeric label viaamountTextField),rewardImage(icon viaArtClip iconMC), andwaitingOnAnimationflag; setsmouseChildren = false. The two percent setters clamp to 0–1 and invalidate only on a change. Ondraw()scalesfillingMaskMCandnewProgMaskMCwidths proportionally and moves ahighlightsprite (geode bars only) to the leading edge. WhennewProgressPercentreaches 1 and no animation is pending, plays the embeddedrewardAnimationMovieClip and firesPOST_SOUND_EVENT— only the two star bars have one. Shows/hides acompleteMCoverlay at 100% (tome and auto-use bars only; the star bars have none).StarProgressBar— extendsProgressBar; embeds symbol67; two frame stops (PC / Console).TomeProgressBar— extendsProgressBar; embeds symbol65; two frame stops.AutoUseTomeProgressBar— extendsProgressBar; embeds symbol63; two frame stops.StarProgressBarGeode— extendsProgressBar; embeds symbol51; two frame stops (Geode variant of star bar).TomeProgressBarGeode— extendsProgressBar; embeds symbol28; two frame stops.AutoUseTomeProgressBarGeode— extendsProgressBar; embeds symbol24; two frame stops.ReliquaryItem— extendsMovieClip; embeds symbol81. Represents a mega Reliquary reward slot with anArtClip image, anxpBarfill strip scaled viascaleX, acompleteMCoverlay shown at fill ≥ 1. Exposesfill(Number 0–1) andiconImage(String texture name) setters, which the engine writes directly; each applies only on a change, andiconImagesizes the image to 63×63.EventHighlight— extendsUIComponent; embeds symbol6. Displays an event description label with an auto-sizing text field and a background scaled to fit. On consolehtmlTextis used; on PCtext. CallsfitBackgroundToText()to resize the background MovieClip to match text height.StarBar_fla/reward_animation_13— extendsMovieClip; embeds symbol47. The 47-frame reward burst animation. Stops at frame 47 viahalt(). Placed as therewardAnimationchild inStarProgressBarandStarProgressBarGeodeonly.
Notable logic
- Dual-mode symmetry: every data setter (
setNewProgressPercent,setFilledPercent,setRewardAmount,setRewardImage) unconditionally updates both the normal and geode bar at the given index. Visibility is then controlled separately bysetVisible+m_mode, so the engine can switch modes without resending all data. The geode bars have noamountTextFieldoriconMC, so the reward count and image appear only on the normal bars. - Dynamic height reflow:
UpdateHeightis the only mechanism that resizes the component, and it runs only fromsetVisible(every call) andsetMegaVisible(on an actual change); the progress, reward and mode setters never reflow. It packs visible bars contiguously using pre-captured Y positions, then places both mega slots at the same Y regardless of individual visibility, and broadcasts the new pixel height to the engine viaNOTIFY_RESIZED(fixed width 374). The formula48 + n * 40 + (megaVisible ? 88 : 0)encodes the bar row height (40 px) and mega section height (88 px). - Animation gating:
isWaitingOnAnimationlets the engine pause furthersetNewProgressPercentcalls while the reward animation is playing, preventing visual glitches from overlapping fills.ProgressBarclearswaitingOnAnimationand resetsfilledPercentto 0 in the last-frame script ofrewardAnimation. Only the star bars carry arewardAnimation; at 100% the tome and auto-use bars just showcompleteMCand never setwaitingOnAnimation. - Sound: reward sound
"Play_ui_starbar_reward"is triggered from withinProgressBar.set newProgressPercentviaPOST_SOUND_EVENT, not fromStarBaritself, and only for the star bars.