worldtooltip.swf
Rich item/world-object tooltip panel displayed when the player hovers over or inspects an item in Trove. Supports a primary info panel with a name, stat rows, and an optional side compare panel showing stats of the currently equipped item.
Document/main class: Tooltip (extends _kiwi.Core.UIComponent)
SWF-specific classes: 3
Main class: Tooltip
Tooltip is the root component. It starts invisible and builds its layout from data pushed via ExternalInterface. The constructor hides the component, clears any previous content, and attaches a ComparePanel child. Layout is driven by an invalidation system inherited from UIComponent; DATA invalidation triggers recalculateStaging() and STYLES invalidation reapplies name-text color/effects. After every layout pass it calls ExternalInterface.call("NOTIFY_RESIZED", width, height) so the game host can reposition the tooltip.
Public methods
clear() : void— resets display name, hides compare panel, shrinks height to name field height, clears theStackList, starts a fresh pending row.newRow() : void— commits the currentpendingRowintorowsStackList and starts a newAlignmentCellsRow.setRowCell(align:uint, text:String, color:uint, size:Number, font:String) : void— creates aTextFieldwith the given format and places it in the pending row at the specified alignment cell;textis applied ashtmlText. Enables word-wrap if text exceeds panel width. Font size is the sentsize+ 3 (+2 more on console). The engine sends every non-stat line through here: flavour text, requirements, and a caught fish's weight ($FishWeightFormat, "Weight: {0:f2} lb").addStat(label:String, value:String, color:uint, bonusLevel:int) : *— wraps aStatRow(label+value) in the pending row's left cell and auto-advances to a new row.bonusLevel(the stat's boost-arrow count) has no effect here: this SWF'sStatRowsymbol (chid 8) carries onlynameTextField,valueTextFieldandbonusTextField, nobonusLevelClip.addLineBreak() : void— inserts a centered decorative horizontal line shape as a row.clearStats() : void— delegates tocomparePanel.clear()and invalidates.setSidePanelEdge(edge:int) : void— positionscomparePanelto the left (EDGE_LEFT), right (EDGE_RIGHT), or below (EDGE_BOTTOM) the primary panel, or hides it (EDGE_HIDE).getPrimaryPanelWidth() : int— returnsbackground.width; called by the host to size the compare panel offset.
Key fields
background : MovieClip— the panel backdrop (chid 10, a nine-slice box); its width and height are resized dynamically.nameTextField : TextField— displays the item/object name (chid 13, placeholder "World Object"); supports multiline wrap for long names.rows : StackList— vertical container for allAlignmentCellsRowchildren.pendingRow : AlignmentCellsRow— the row currently being built before being committed torows.qualityMeter : QualityMeter— declared but never placed on this SWF's timeline, so thequalitysetter does nothing here and world tooltips show no quality meter.headerBar : MovieClip— declared but never placed on this SWF's timeline; every header-bar branch is skipped, so the name sits directly onbackgroundwithrows3 px below it.comparePanel : ComparePanel— side panel for gear comparison stats; created in constructor._color : uint— name text color (default white0xFFFFFFFF)._rainbow : Boolean— when true, applies per-character rainbow coloring to the name._shadow : Boolean— when true, applies a drop-shadow + glow filter to the name.firstStatRow : int— y-position of the first stat row, used to align the compare panel vertically.
Frame scripts / timeline
None — Tooltip is a pure ActionScript component with no frame scripts. The root timeline places only background, nameTextField and rows (chid 11).
Runtime dependencies & integration
IggyFunctions.inIggy— gates the callbacksTooltip.configUI()registers; in preview mode populates sample data instead.ExternalInterface.addCallback(...)— game registers:NEW_ROW,SET_ROW_CELL,LINE_BREAK,ADD_STAT,CLEAR_STATS,SET_SIDEPANEL_EDGE,CLEAR,REDRAW,getPrimaryPanelWidth.COMPARISON.ADD_STATis registered separately, fromComparePanel's constructor and outside theinIggygate.- Property writes — the engine assigns
displayName,minWidth,color,rainbow,shadowandqualitydirectly; nothing in the SWF sets them apart from the constructor andclear()resets.minWidtharrives as 450, and colours arrive as0xAARRGGBBwith the alpha byte set. ExternalInterface.call("NOTIFY_RESIZED", width, height)— notifies host after every layout recalculation. The host scales the tooltip to a fixed on-screen width from the reported width, so a wider report draws everything smaller; with the 450 px floor almost every world tooltip reports exactly 450 and renders at one size.ExternalInterface.call("RequestRedraw")— signals host that a visual redraw is needed after draw().IsConsole()— bumps font sizes by 2 insetRowCell.fl.motion.Color— used to build the rainbow color array (six Color transforms: red, orange, yellow, green, cyan, purple).flash.filters.DropShadowFilter/GlowFilter— blue inner drop shadow plus purple glow, applied tonameTextFieldwhenshadowis set (shadow-tier names);rainbowtakes precedence when both are set.
Other game-specific classes
ComparePanel(extends_kiwi.Core.UIComponent) — Embedsymbol12; side panel that lists comparisonStatRowentries viaCOMPARISON.ADD_STATcallback. Expands width to fit the widest stat row. CallsExternalInterface.call("RequestRedraw")after each data invalidation. ExposesChildCountandStatListPositiongetters used byTooltipfor vertical alignment.QualityMeter(extends_kiwi.Core.UIComponent) — displays item quality as a frame-based clip. Clamps quality to 0–5 and callsgotoAndStop("lvl" + quality)on draw. Compiled in but unused here:SymbolClassbinds no symbol to it (onlyTooltip,ComparePanel→ 12,StackList→ 11,StatRow→ 8) and no instance is placed.
Notable logic
- The tooltip width is always at least
DEFAULT_MIN_WIDTH(450 px) and the name field word-wraps aboveDEFAULT_MAX_WIDTH(640 px). - Rainbow coloring cycles through six preset
fl.motion.Colorobjects character-by-character usingsetTextFormaton individual char ranges. recalculateStaging()handles three layout cases: compare panel taller than primary (expands height), no stat rows (vertically centers compare panel), or stat rows present (aligns compare panel'sStatListPositiontofirstStatRow).- After every staging recalculation,
NOTIFY_RESIZEDis called so the C++ host can move the tooltip window.