forge.swf
The Forge crafting window, opened at Forge stations in Trove. Allows players to upgrade equipment by dragging items into a central slot, selecting an upgrade type (standard, chaos, pearl/enchanted, tome, particle), viewing required ingredients, comparing before/after stats, and confirming the upgrade. Supports four station types with different forge-mode sub-menus.
Document/main class: Forge2 (extends _kiwi.Core.UIComponent)
SWF-specific classes: 6 (main class + 5 Forge_fla timeline symbols + 2 asset helpers)
Main class: Forge2
Large, stateful crafting UI. On PC, ConstructForgeMenu() is called immediately from the constructor; on console, it is deferred via ENTER_FRAME until onTargetFrame(). ConfigureForgeMenu() wires all mouse events, registers drag-drop, and sets up per-equipment-type ArtClip slots. Station type (standard / chaos / pearl-enchanted / tome+particle) is set by SET_STATION_TYPE and drives which forge options and icons are shown.
Public methods
setStationType(type:int) : void— setsstationType, callsapplyStationType()on PC; on console deferred to post-configure.setForgeType(index:int) : void— cycles withinforgeOptionsarray; callsExternalInterface.call("OnSelectUpgradeType", upgradeTypeCode). The code is2for"tome",6for"particle", andcurrentUpgradeTypefor"pearl", i.e. whichever of0(add stat) or5(boost stat) the engine last offered throughaddUpgrade;"standard"and"chaos"send nothing.addIngredient(texName, name, desc, numHave, numNeed) : void— adds ingredient data toingredientList, updatesrequiredItems.ingredient_Ndisplay (count text coloured red if insufficient), repositions slots to centre 1–3 ingredients, firesExternalInterface.call("OnConfigured", numIngredients, 4, 2).reset() : void— registered asRESET_INGREDIENTS; clearsingredientList, disablesbtn_upgrade, hides all ingredient slots, clears before/after text, and firesOnConfigured(0, 4, 2).setEquipmentImage(slotId, iconImage, starLevel, itemName, rarity) : void— assigns an icon to one of the four equipment preview slots by the engine's slot id (0weapon,4hat,5face,6ring), incrementsslotsEquipped. The engine writes all four slots, the ring included at the chaos forge, and does not re-send them after a forge, so the row keeps showing the pre-forge item until the window is reopened.transferFromEquipment(x, y) : void— hit-tests equipment previews at a coordinate and triggers an internal drop if found.onPrevUpgradeType / onNextUpgradeType(event) : void— cyclescurrentForgeTypewithinforgeOptionswith wrap-around.getItemContainingPoint(point) : MovieClip— returnscurrentForgeif it hit-tests the given point; used for drag-drop targeting.
Key fields
forgeType : String— current forge mode string:"standard","chaos","pearl","tome","particle".stationType : int— index intostationTypes/stationNames/allForgeOptions(0=standard, 1=chaos, 3=pearl/enchanted; index 2 has options but anulltype and name).forgeOptions : Array— sub-modes available for this station type, e.g.["pearl","tome","particle"], copied fromallForgeOptions = [["standard"],["chaos"],["pearl","tome"],["pearl","tome","particle"]].stationTypes : Array—["standard","chaos",null,"pearl"].stationNames : Array—["$Forge_Header_Forge","$Forge_Header_ChaosForge",null,"$Forge_Header_EnchantedForge"](English "FORGE", "CHAOS FORGE", "ENCHANTED FORGE").btn_upgrade : LabelButton— craft button; label set bySET_BUTTON_TEXTcallback; click firesUPGRADE_REQUEST.lockButton : LabelButton— declared, but no frame of the SWF places it, andonLockClick(which would sendLOCK_REQUEST) is never attached to anything.SHOW_LOCK_BUTTONsetslockButton.visible;ENABLE_LOCK_BUTTON(Boolean)ignores its argument and only invalidates.currentForge : MovieClip(symbolcurrentForge_7) — centre slot containingartClip:image,forgeBG,forgeTypeIcon,btn_prev,btn_next.requiredItems : MovieClip(symbolrequiredItems_16) — holds up to 3ingredient_Nsub-clips and astarLevelclip.statComparisonLeft / statComparisonRight : StackList— before/after stat columns populated byADD_STAT_COMPARE.beforeTxt / afterTxt : TextField— text preview for upgrades that don't use stat rows (tome level display, particle aura names, chaos warnings).ingredientList : Array— array of ingredient data objects{slotTextureName, name, description, numHave, numNeed, txtColor}.selections : Array— ordered list of focusable elements for console navigation (forgeBG, 3 ingredient slots, btn_upgrade, 4 equipment slots).timer : Timer— 500ms delay before showing ingredient tooltip on console hover.equipmentTypes : Array—["item_hat","item_weapon","item_face","item_ring"].numChaosSlots : int— number of leading stats the chaos forge keeps (default 2, set viasetNumChaosSlots); the stats after them are the ones it rerolls. It is the kept count, not the rerolled count.MAX_NUM_STATS : int— stat count at which the enchanted forge preview switches from adding a stat to boosting one (default 4, set viasetMaxStats).
Frame scripts / timeline
- frame 1 (
stop(), label"PC") — PC layout. - frame 11 (
stop(), label"Console") — Console; sendsBG,header,requiredItems,btn_upgrade,currentForgeto"Console"label.buttonLegendis placed only from this frame on. - frame 21 (
stop(), label"ConsoleLoc") — Console + localisation; same children directed to"Console".
Runtime dependencies & integration
ExternalInterface callbacks registered: SET_BUTTON_TEXT, addUpgrade, clearUpgrades, ADD_STAT_COMPARE, RESET_STAT_COMPARE, ADD_AURA_COMPARE, setSelected, setNumChaosSlots, setMaxStats, addIngredient, RESET_INGREDIENTS, setForgedItem, SHOW_LOCK_BUTTON, ENABLE_LOCK_BUTTON, setEquipmentImage, SET_STATION_TYPE, transferFromEquipment, onPrevUpgradeType, onNextUpgradeType, highlightSelection, unhighlightSelection, activateSelection. objectPreviewReady, DRAGHOST.DROP and UIComponent.onStageResized are registered by the shared ObjectPreview, SlotDragDropHelper and UIComponent classes.
addUpgrade(code)— the engine lists the upgrades on offer:0add stat,1standard upgrade,2reduce minimum level,3increase rarity,4pick new stats,5boost stat,6new particles.clearUpgrades()resets every flag except the particle one (6).setSelected(unused, subHeaderText, upgradeEnabled)— the first argument is read by nothing; the second fillssubHeader.txt_label, the third enablesbtn_upgradeand drives the preview text.setForgedItem(icon, name, rarity, titleColor, quality, minLevel)— the item now in the centre slot;qualityselectsrequiredItems.starLevelframequality + 1,minLevelfeeds the tome preview.ADD_STAT_COMPARE(isLeft, name, value, valueColor)— the fourth argument is a colour applied to the row's value text. No pearl/bonus level is sent to this screen (the tooltip'sADD_STATreceives one), soStatRow's bonus fields are never set here.
ExternalInterface calls out: OnConfigured(numIngredients, slotsPerRow, numRows), OnSelectUpgradeType(typeCode), OnSetForgeFromEquipped(slotId), OnDropIntoWindow(texName, rarity, qty), UIComponent.OnShowTooltip(x, y, name, desc), UIComponent.OnHideTooltip(), UPGRADE_REQUEST, FORGE.REQUEST_CLOSE, POST_SOUND_EVENT("Play_ui_forge_use"), POST_SOUND_EVENT("Play_ui_window_drop_interactive"), POST_SOUND_EVENT("Play_ui_window_click_item"). LOCK_REQUEST (onLockClick) and APPEARANCE_REQUEST (onAppearanceClick) have handlers that are never attached to any control, so neither is ever sent.
Drag-drop: SlotDragDropHelper.registerDropCallback(onItemDropped) — receives external drag drops; equipment preview items use native startDrag/stopDrag with MouseEvent.MOUSE_UP completion.
Visual effects: DropShadowFilter + GlowFilter applied to currentForgeTitle when setForgedItem's rarity is ≥ 7 (Rarity_Shadow1 in _kiwi.Controls.Slot's rank table, so Shadow and every tier above it). GlowFilter (yellow) applied to highlighted selection.
Translate keys: $Forge_Header_Forge, $Forge_Header_ChaosForge, $Forge_Header_EnchantedForge, $Forge_Button_Upgrade, $Forge_Add_Stat, $Forge_Boost_Stat, $Forge_Cannot_Boost_Stats, $Forge_Required_Level, $Forge_Required_Level_Max, $Forge_Cannot_Add_Particles, $Forge_Cannot_Chaos, $Forge_Legend_Set.
Stage resize: onStageResized scales backBanner.height = stageHeight/scaleY * 1.5.
Other game-specific classes
Forge_fla.currentForge_7 (extends MovieClip) — Embed symbol142
Centre forge slot panel. Children: artClip:image (the item being forged), forgeBG:MovieClip (driven by gotoAndStop(forgeType)), forgeTypeIcon:MovieClip, btn_prev, btn_next. Four-frame stop scripts (PC/console layout variants).
Forge_fla.requiredItems_16 (extends MovieClip) — Embed symbol158
Ingredient display tray with ingredient_0/1/2:MovieClip and starLevel:MovieClip. Sends ingredient sub-clips to "Console" label on frame 11.
Forge_fla.btn_skip_11 (extends MovieClip) — Embed symbol127
Four-state button clip (up/over/down/disabled) used as the skip/prev/next navigation button.
Forge_fla.bannerTop_2 / Forge_fla.bannerBottom_5 / Forge_fla.forgeBG_8 / Forge_fla.forgeBG_chaos_10 / Forge_fla.mainBG_6 / Forge_fla.arrow_chaos_22 / Forge_fla.forgeType_12 / Forge_fla.starLevel_17 / Forge_fla.itemSlot_24 / Forge_fla.requiredItem_19
Timeline symbol classes for background panels, decorative arrows, forge-type icons, star-level indicators, and item slot frames. All are pure layout/animation clips with stop() frame scripts; no game logic.
Asset helpers
image(extends_kiwi.Controls.ArtClip) — Embed symbol78; the item-art display in the centre forge slot (currentForge.artClip).btnGreen(extendsLabelButton) — Embed symbol76; green action button with four-state frame stops.rarity_frame_*(×12 PNG/asset wrappers) — rarity border graphics for ingredient slots.dummy— 48×48 placeholderBitmapDataembed (25_dummy.png).
Notable logic
- Stat comparison columns:
ADD_STAT_COMPARE(isLeft, statName, statValue, color)adds aStatRowto eitherstatComparisonLeft(current stats) orstatComparisonRight(projected stats). For chaos forge, the right column is computed insetChaosForgeRightStatRows: keepsnumChaosSlotsexisting stats and pads the rest with"???"rows to show randomisation. - Enchanted (pearl) preview: while the left column holds fewer than
MAX_NUM_STATSrows the after text is$Forge_Add_Stat("Adds a new, random stat bonus!"), otherwise$Forge_Boost_Stat("Boosts a random stat."); with the upgrade disabled but every ingredient present it is$Forge_Cannot_Boost_Stats("This item's stats are already fully upgraded."). The game picks the stat; nothing on this screen chooses one. - Chaos preview: with the upgrade disabled the after text is
$Forge_Cannot_Chaos("Only items with 3 or more stats can be modified at the Chaos Forge."). - Aura/particle preview:
ADD_AURA_COMPARE(oldAura, newAura)stores strings inbeforeTxt/afterTxtusing HTML<font size=18>and hides the left stat column; an emptyoldAurashows$Forge_Cannot_Add_Particlesinstead. - Tome preview: shows current required level vs. reduced level in
beforeTxt/afterTxtas HTML<font size=14>. - Ingredient display: amounts > 5 digits shown as
"*"to avoid overflow. Insufficient amounts shown in#FF3333red. - Console tooltip timer: a 500ms
TimerfiresshowTooltipafter highlighting an ingredient slot; unhighlighting cancels the timer and callsUIComponent.OnHideTooltip. IsNX()branch: NX Switch-specific layout call toPositioningButtonsfor repositioningbuttonLegend.