lootcollector.swf
The Loot Collector station's window — it lists the collectable items in the player's inventory (collect mode) or the items already collected that can be bought back (buyback mode). The player can lock individual items to protect them, then collect or buy back the rest individually or all at once. The window toggles between the two modes, and the Compost station reuses it with its own wording.
Document/main class: LootCollector (extends _kiwi.Core.UIComponent)
SWF-specific classes: 15
Main class: LootCollector
LootCollector is the root document class. It owns a scrollable list of loot rows (LootList/LootRow), an InlineTooltip for item stat details, a reward-slot preview area (collectionInfoWindow), and a button strip (collectionButtonInfo). The class tracks two mutually exclusive modes — collect (deconstruct items) and buyback (repurchase previously deconstructed items) — and two station contexts: generic and Compost (station id 8), which swaps all translate keys to Compost-specific strings.
In the constructor, frame scripts are registered for frames 1 and 16 (indices 0 and 15), the loot list is configured (spacing, scrollbar, events), the five reward preview slots are initialised and hidden, and the header component property $Deconstructor_WinTitle is written. configUI() fires after the component tree is ready and registers every public method as an ExternalInterface callback. In non-Iggy (test) mode it pre-populates 20 dummy rows instead.
Public methods
addCollectableLoot(slotId:int, iconImage:String, name:String, masteryText:String, quantity:int, rarity:int, showQuantity:Boolean, quality:int) : void— creates aLootRowMovieClip, assigns icon/rarity/quantity/quality to its embeddedSlot, sets name and mastery text fields, and appends it tolootListviaaddItemWithId. On console, automatically callsShowSlotDetailsfor the first row added.iconImageis an engine render-target name (LootCollector.Id_<uid>.unlocked.0for gear and gems,LootCollector.<prefab path>.unlocked.0for many other items, e.g. placeables);nameis the item's name translation key, which is its prefab path (e.g.$prefabs_loot_hat_gearcrafting_physical_name).updateLootQuantity(slotId:int, quantity:int) : void— looks up the row by id and updates the slot's quantity display.clearSlotDetails() : void— clears thestatDetailsInlineTooltip and hidescollectionInfoWindow.helpText.refreshList() : void— clears the entire list, slot details, and reward slots. The engine calls it, followed by a full resend of the list, only after a collect or buy-back fails.formatRewardSlots(count:int) : void— positions the firstcountreward slots (rewardSlot0–4) centred horizontally and hides/clears the rest; a slot becomes visible whenaddDeconstructRewardfills it.countis the number of rewards the item last shown pays (the window passes 0 itself when the pointer leaves the rows).showSlotDetails(slotId:int, name:String, description:String, quantity:int, rarity:int, showQuantity:Boolean, quality:int) : void— delegates the last six tostatDetails.showSlotDetails(...)(name, description and the largeSlot's rarity/quantity/quality), moves the row to "selected" or "lockedSelected" frame, and showshelpText. The only part of a details reply that names its item.showInlineTooltip(powerRank:int, rarityLine:String, rarityColor:uint, showDelta:Boolean, delta:int, deltaColor:uint) : void— delegates tostatDetails.showInlineTooltip(...)if the last-shown row still exists:powerRankRowgets$NoRarityPowerRank("POWER RANK {0}") plus an optional coloured(+delta),rarityRowgetsrarityLineinrarityColor. The rarity line is$EquipmentRarityFormat({0} {1}: rarity plus an$ItemType_*word, e.g. "Mystic Hat") for gear,$GemLevelRarity({0} - Level {1} / {2}) for gems, and empty for items such as placeables and crafting materials.toggleSlotLock(slotId:int) : void— only active in MODE_COLLECT. Toggles thelockedboolean on theLootRowMovieClip, moves it to the appropriate timeline frame (locked/unselected/lockedSelected/selected), callsExternalInterface.call("LockSlot", slotId, locked), and refreshes the collect-all button's enabled state.-1(or the hovered id) means the hovered row, which is also re-selected and re-detailed viaShowSlotDetails. The engine calls it right afteraddCollectableLootfor every row that is already locked.collectAll(event:MouseEvent = null) : void— iterates every child oflootList.viewportMovieClip; for each unlockedLootRowcallsDeconstructItem(id, false, true)/BuyBackItem(id, false), then callsDeconstructAll/BuyBackAllonce at the end. In buyback the per-rowBuyBackItemcalls queue the items andBuyBackAllasks for confirmation ($Deconstructor_BuyBackConfirm, "Are you ready to buy back these {0} unlocked items?") when more than one is queued; on Yes the engine sendscollectLootfor each queued id.collectSlot() : void— collects or buys back the currently highlighted slot (uses_lastSlot). CallsDeconstructItem/BuyBackItemif unlocked, orDeconstructItemFailed/BuyBackItemFailedif locked.toggleMode(event:MouseEvent = null) : void— callsExternalInterface.call("ToggleMode")with no additional args. The engine flips the mode itself and answers inside the call withsetMode(mode, station)followed by oneaddCollectableLootper item.addDeconstructReward(slotIndex:int, iconImage:String, quantity:Number, showQuantity:Boolean) : void— populates one of the fiverewardSlotentries incollectionInfoWindow(for the item last shown) and makes it visible.collectLoot(slotId:int) : void— removes the row fromlootListby id, callsShowSlotDetailson the returned next-row id, and refreshes the collect-all button. The engine calls it once for each item that leaves the list after a collect or buy back.setMode(mode:int, station:int) : void— switches between MODE_COLLECT (0) and MODE_BUYBACK (1). Clears the list and detail pane, then updates the list title, help text, button labels, and button labels for both PC and console layouts based on mode + station. No-ops if mode is unchanged. The engine sends it when the window opens and on everyToggleMode, before the list.updateCollectAllButton() : void— enables the collectAll button only if at least one row is unlocked; disabled state is only applied on non-console.moveSlotCursor(direction:int) : void— console D-pad navigation. Gets the adjacent row id fromlootList.getAdjacentItemId, callsShowSlotDetails, and scrolls the list if the row is outside the visible window (assumes 6.91-pixel row height, 5 rows visible, 3.55-pixel initial offset).getPackedSlotPosition(index:uint) : int— returns a 32-bit int with the global X in the high 16 bits and global Y in the low 16 bits for the row at the given viewport child index.getPackedSlotSize(index:uint) : int— returns a 32-bit int with width in the high 16 bits and height in the low 16 bits for the row at the given index.
Key fields
lootList : LootList— the scrollable tile view holding allLootRowentries.statDetails : InlineTooltip— shows item stat info to the right of the list.collectionInfoWindow : MovieClip(collectionInfoWindow_17) — containsrewardSlot0–rewardSlot4(each aslot_large) and ahelpTextTextField.collectionButtonInfo : MovieClip(collectionButtonInfo_18) — containscollectAllBtn(btnGreen),toggleModeBtn(btnBuyback),helpText, andlockTextTextFields.collectAllText : TextField— console-only label above the collect-all button.collectText : TextField— console-only label above the single-collect button.button_console_north : MovieClip— console button prompt visible only in collect/buyback modes.consoleBtnLock : MovieClip— console lock button, visible only in MODE_COLLECT.m_header : WindowHeaderSmall— window title bar; title set to$Deconstructor_WinTitle,allowFontResize = true.mode : int— current mode (-1 uninitialised, 0 = collect, 1 = buyback).m_station : int— station type id; 8 = Compost (changes all visible strings to Compost variants).slotHovered : int— id of the row under the mouse cursor (-1 if none)._lastSlot : int— id of the row last shown in the details pane; setter deselects the previous row's frame.
Frame scripts / timeline
- Frame 1 (
frame1, labelPC) —stop(). - Frame 16 (
frame16, labelConsole) —stop(). The console layout: placesbutton_console_north,button_console_south,collectAllText,collectTextandconsoleBtnLock.
Runtime dependencies & integration
Iggy / ExternalInterface callbacks registered (in → Flash):
addCollectableLoot, updateLootQuantity, clearSlotDetails, refreshList, formatRewardSlots, showSlotDetails, showInlineTooltip, toggleSlotLock, addDeconstructReward, collectLoot, moveSlotCursor, collectSlot, collectAll, setMode, getPackedSlotPosition, getPackedSlotSize
The embedded InlineTooltip (statDetails) registers two more itself: ADD_STAT(name, value, color, bonusLevel) and COMPARISON.ADD_STAT(name, value, color), which fill its seven stat rows.
ExternalInterface calls (Flash → game):
ShowSlotDetails(slotId), LockSlot(slotId, locked), DeconstructItem(slotId, singleItem, collectAll), DeconstructItemFailed(slotId, singleItem), DeconstructAll(), BuyBackItem(slotId, singleItem), BuyBackItemFailed(slotId, singleItem), BuyBackAll(), ToggleMode()
IggyFunctions.inIggy — gates the entire ExternalInterface setup; falls back to populating 20 test rows in Flash preview mode.
IsConsole() — global function call that branches the layout: hides collectionButtonInfo button strip and instead shows consoleBtnLock, button_console_north, collectAllText, collectText; also auto-focuses the first row on console.
translate keys used:
$Deconstructor_WinTitle, $LootCollector_List_Title_Inventory, $LootCollector_List_Title_BuyBack, $LootCollector_Compost_List_Title_BuyBack, $LootCollector_CollectToEarn, $LootCollector_CompostToEarn, $LootCollector_BuyBackCost, $LootCollector_CollectionText_Right, $LootCollector_Compost_CollectionText_Right, $LootCollector_CollectionText_Lock, $LootCollector_CollectionBtnLabel, $LootCollector_Compost_CollectionBtnLabel, $LootCollector_BuyBackBtnLabel, $LootCollector_BuyBackText_Right, $LootCollector_Console_CollectAllBtnLabel, $LootCollector_Compost_Console_CollectAllBtnLabel, $LootCollector_Console_CollectBtnLabel, $LootCollector_Compost_Console_CollectBtnLabel, $LootCollector_Console_BuyBackAllBtnLabel, $LootCollector_Console_BuyBackBtnLabel
Other game-specific classes
Top-level classes
LootRow—MovieClipsubclass, embedssymbol57. Holds aSlot(icon/rarity/quantity/quality),nameTextandmasteryTextTextFields, andbackgroundUnlockedclip. Four timeline states, frame-labelledunselected(1),selected(13),locked(25) andlockedSelected(37).lockedis a dynamic property set at runtime.LootList—SpliceableTileViewsubclass, embedssymbol141. Thin typed wrapper; all scrollable-list behaviour comes from the framework.slot_large—Slotsubclass, embedssymbol170. Used as the five reward preview slots incollectionInfoWindow; sized to 77 px viasetSlotSize(77).btnGreen—LabelButtonsubclass, embedssymbol160. Four 10-frame button states (up/over/down/disabled). Used as the collect-all / buy-back-all primary action button.btnGreen_small—LabelButtonsubclass, embedssymbol83. Smaller variant ofbtnGreen; present in the library but not directly referenced inLootCollector.as.btnGreenIcon_small—LabelButtonsubclass, embedssymbol73. Icon-bearing small green button; present in the library.btnBuyback—BaseButtonsubclass, embedssymbol150. The mode-toggle button (toggleModeBtn) incollectionButtonInfo.dummy—BitmapDatawrapping/_assets/26_dummy.png(52×52). Placeholder icon asset.
LootCollector_fla timeline symbols
collectionInfoWindow_17—MovieClip, embedssymbol195. Container forrewardSlot0–rewardSlot4(slot_large) and ahelpTextTextField. Reward slots are positioned and shown/hidden byformatRewardSlots(). Frames are labelledCollectibles(1) andBuyBack(2); the stock code never switches them.collectionButtonInfo_18—MovieClip, embedssymbol200. Two-frame clip, labelledCollectibles(1) andBuyBack(2), which the stock code never switches (setModerewrites the labels instead), holdingcollectAllBtn(btnGreen) andtoggleModeBtn(btnBuyback), plushelpTextandlockTextTextFields.__setPropguards prevent duplicate initialisation.listTitle_39—MovieClip, embedssymbol140. Single-frame clip with atitleTextField; used as the header row ofLootList.qualityPips_16—MovieClip, embedssymbol42. Single-frame stop; displays quality pip indicators insideSlot.slotFrame_47—MovieClip, embedssymbol21. Three-frame clip (stop on each); rarity-border frame for regular-size slots.slotFrameLarge_7—MovieClip, embedssymbol165. Four-frame clip (stop on each); rarity-border frame for large (77 px) slots used in the reward preview area.bonusClip_4—MovieClip, embedssymbol180. Six-frame clip (labelslvl0–lvl5) withlevel_0–level_4sub-clips; it is thebonusLevelchild of eachInlineTooltipstat row, andADD_STAT's fourth argument picks its frame (gotoAndStop(bonusLevel + 1)).equipped_9—MovieClip, embedssymbol25. Two-frame clip; equipped-item overlay badge on a slot.
Asset wrapper classes (bitmap/shape only — not individually detailed)
9 classes: rarity_frame_epic_png, rarity_frame_legendary_png, rarity_frame_crystal_png, rarity_frame_mystic_png, rarity_frame_radiant1_png, rarity_frame_rare_png, rarity_frame_relic_png, rarity_frame_resplendent_png, rarity_frame_shadow_png, rarity_frame_uncommon_png, rarity_frame_stellar — all BitmapData subclasses embedding per-rarity border PNGs (77×77). Plus scrollbar skin stubs: ScrollArrowDown_*Skin, ScrollArrowUp_*Skin, ScrollThumb_*Skin, ScrollTrack_skin, ScrollBar_thumbIcon, focusRectSkin (pure shape symbols from the framework scroll bar).
Notable logic
- Lock-before-collect safety: Left-clicking a row in MODE_COLLECT toggles its lock rather than collecting it. Right-click (or the console collect button) collects the row immediately. This prevents accidental destruction of desired items. The
collectAllpath skips any row whoselockedflag istrue. - Details on demand: the window asks
ShowSlotDetails(id)only when the pointer moves onto a new row, for the first row on console, onmoveSlotCursor, when the hovered row's lock is toggled, and aftercollectLoot. The engine answers in the orderADD_STAT× n,showInlineTooltip,showSlotDetails(id, …),formatRewardSlots(n),addDeconstructReward× n. OnlyshowSlotDetailscarries the item id; the other parts land on whatever the pane is showing (showInlineTooltipandaddDeconstructRewardonly check that the_lastSlotrow still exists). The Resplendent rainbow pass inshowSlotDetailsreads therarityRowtext thatshowInlineTooltiphas just written. - Dual station context: All user-visible strings branch on
m_station == STATION_COMPOST(8). The Compost station shares the same window but presents entirely different action verbs ("Compost" vs "Collect/Deconstruct") via separate translate keys. - Console layout: When
IsConsole()is true, thecollectionButtonInfobutton strip is replaced by labelled controller-prompt clips (consoleBtnLock,button_console_north), D-pad navigation is driven bymoveSlotCursor, and the panel auto-focuses the first row. Scroll position is computed using the hard-coded row height constant 6.91 px with a 3.55-offset baseline. - Packed position/size protocol:
getPackedSlotPositionandgetPackedSlotSizeencode two 16-bit values into a single 32-bit int using bit-shift and OR operations. This lets the C++ game layer query row positions for controller cursor overlay rendering without separate width/height/x/y calls. - Reward slot layout:
formatRewardSlots(count)centres up to 5 slots horizontally using the formulax = 161 + (i - (count-1)/2) * (132 - (count-1)*17), compressing the spacing as more slots appear.