shadowtower.swf
The Shadow Tower window, opened when interacting with a Shadow Tower portal. Lets players select a floor (boss), choose a difficulty (Normal/Hard/Ultra), review key costs, and enter the tower, with a second tab showing a leaderboard of completion times per boss and difficulty.
Document/main class: ShadowTower (extends _kiwi.Core.UIComponent)
SWF-specific classes: 10 (excluding skin/scroll stubs)
Main class: ShadowTower
Root component managing two tabs (Portal and Leaderboard), up to 6 floor buttons, difficulty selection, boss art display, key-cost panel, and a reset timer. Floors are selected via node button MovieClips inside a floors container. configUI() wires floor click listeners (with optional console tooltip offsets), tab click listeners, and registers ExternalInterface callbacks. Has three timeline frames (1, 11, 21), all stopped — frame 11 is the console layout.
Public methods
setDefaultDifficulty(index:int, only:Boolean) : void— sets the difficulty throughsetDifficultyHelper(…, false), so a change still sendsOnDifficultySelectedback. When the second argument is true the index is the only difficulty this player has: the other two difficulty clips oncreatePortalare hidden. The engine uses this to refuse a pick: afterOnDifficultySelectedfor a difficulty the player cannot open, it answerssetDefaultDifficulty(0, true)and the selection snaps back.setFloor(bossName:String, bossPortrait:String, accessible:Boolean, defeated:Boolean, reward:String, score:int, fluxCost:int, bestTime:int, powerRank:int) : void— populates one floor button atloadedFloorsindex; builds a localised tooltip from translated strings; setscompletedIconvisibility and enabled state on thenodebutton; stores boss data and callssetCurrentFloorfor floor 0 on first load.bossNameis a translation key (translated on the not-defeated branch only);bossPortraitis an object-preview target;fluxCostfills$ShadowTower_LevelRequirement("It costs {0} Flux to open this portal.");bestTimeis seconds, shown to two places with$TimeUnit_Seconds;powerRankfills$ShadowTower_LootLevelRequirement("You must be Power Rank {0} or higher to gain loot.") and is per floor, appended only when above 1.rewardandscorego into{3}/{2}of$ShadowTower_DefeatedLevel("You defeated {0} in {1} this week!"), which has neither, so they never show.setCurrentFloor(index:int) : void— setsselectedIconvisibility on the active floor node, updates boss art (bossArt.iconImage,setImageSize(392, 220)), and callscreatePortal.setPortalHeading()andleaderboards.setLeaderBoardHeading()with boss name and current difficulty string.showBossIcons(normal:String, hard:String, ultra:String) : void— setsiconImageon each difficulty slot inleaderboards(normal,hard,ultraSlotBasicchildren).updateMaterials(icon:String, cost:int, shadowKeys:int, lunarKeys:int, eclipseKeys:int) : void— setscreatePortal.artClip.iconImage,txt_costtext, and shows/hides key count fields inkeysPanelwith amounts for shadow/lunar/eclipse keys, i.e. the Normal, Hard and Ultra keys (the Hard and Ultra key items are named "Moon Key" and "Eclipse Key"). Only the cost arrives with an icon; no key icon is sent.addLeaderboardEntry(name:String, time:Number, isFriend:Boolean) : void— creates aListingrow, fills rank/name/time fields, handles tie-rank display, colours friend entries green (0x66FF33), marks rank-1 row white on "active" frame.addPlayerLeaderboardEntry(name:String, time:Number, rank:String) : void— fills the player-specific row at the bottom of the leaderboard panel.canEnter(enabled:Boolean) : void— enables/disablescreatePortal.btn_enter.setTimeUntilReset(seconds:Number) : void— formats viaTimeUtil.formatCountdownand fillscreatePortal.txt_timeRemaining.moveHighlight(column:int, delta:int) : void— console D-pad navigation.column < 1moves floor selection (up/down throughnodebuttons);column == 1moves difficulty selection (cycles through normal/hard/ultra). ManageslastHightlight(selectedIconon floor nodes vs.selectionGlowon difficulty buttons).switchTabs() : void— toggles between Portal and Leaderboard tab MovieClips. When switching back to Portal ifdisplayDirtyis true, callsExternalInterface.call("OnDifficultySelected", currentDifficulty).setLeaderboardSize(n:int) : void— resets leaderboard entry counter and clears therowView.scrollBarTranslate(value:Number) : void— updates leaderboard scrollbar position.
Key fields
leaderboards : ShadowTowerLeaderboard— the leaderboard tab panel.createPortal : ShadowTowerCreatePortal— the portal entry tab panel.floors : MovieClip— container holdingfloor_0–floor_5asnode(BaseButton) instances. Each floor's tooltip is set through the button'sUITooltipTitle/UITooltipDescription.keysPanel : MovieClip— shows shadow/lunar/eclipse key counts. On itsPCframe it carries one key icon (bitmap character 170, the only key art in the SWF), one name field (lunarKeyText, holding$prefabs_item_key_delvekey_01_name, "Delve Shadowkey") and the three amount fields; itsConsoleframe addsshadowKeyText/lunarKeyText/eclipseKeyTextlabelled$ShadowKey,$LunarKeyand$EclipseKey, keys defined in no shipped language file.currentDifficulty : int— index intodifficultiesarray (["normal","hard","ultra"]).difficultyString : String— translated difficulty label for heading display.keyType : String— translated key type name for tooltip.currentFloor / loadedFloors : int— track which floor is selected and how many have been set.bossData : Array— cached per-floor data (name, portrait, accessible, defeated, etc.).lastHightlight : MovieClip— the currently console-highlighted element.displayDirty : Boolean— true when difficulty changed while on Leaderboard tab; triggersOnDifficultySelectedon tab switch.
Frame scripts / timeline
- Frame 1:
stop()— PC layout. - Frame 11:
stop()— Console layout (fires when the SWF is running on a controller-based platform). - Frame 21:
stop()— third layout variant (NX/Switch). - Stage 762×600 at 30 fps, 30 frames.
Runtime dependencies & integration
ExternalInterface.addCallbackregistrations:setLeaderboardSize,setDefaultDifficulty,setFloor,showBossIcons,updateMaterials,addLeaderboardEntry,addPlayerLeaderboardEntry,canEnter,setTimeUntilReset,moveHighlight,switchTabs,scrollBarTranslate.- Outbound
ExternalInterface.call:OnDifficultySelected(index),OnFloorSelected(floor),OnAccept(),OnLobbyClicked(),GetLeaderboard(floor, difficulty). IggyFunctions.translate— used for difficulty strings, key type names, and floor tooltip text construction.TimeUtil.formatCountdown/_kiwi.Util.FormatCountdownResult— formats the reset countdown.- Translate keys include:
$ShadowTower_LeaderboardHeading1,$ShadowTower_LeaderboardHeading2,$ShadowTower_PortalHeading,$Open.setDifficultyHelperalso translates$ShadowTower_KeyNormal/_KeyHard/_KeyUltraintokeyType, butkeyTypeonly fills a{1}that$ShadowTower_LevelRequirementdoes not contain, so it never shows (and$ShadowTower_KeyUltrareads "Moon Key", the same as_KeyHard). showToolTip/hideToolTip(SLOT.POINTER_ENTER,TOOLTIP.SHOW,TOOLTIP.HIDE) are never attached to any listener, so those calls are never made from this class.
Other game-specific classes
ShadowTowerLeaderboard(extendsUIComponent, embedssymbol132) — leaderboard panel. Hasnormal/hard/ultraSlotBasicdifficulty filter buttons (click dispatchesDataEvent(SET_DIFFICULTY)),rowView:RowViewfor scrollableListingrows, rank/name/time header labels.addLeaderboardEntrycreatesListinginstances and handles ties and friend colouring.ShadowTowerCreatePortal(extendsUIComponent) — portal entry panel. Hasnormal/hard/ultradifficulty toggle MovieClips (withselectionGlowchild),bossNameText,bossArt:ArtClip,btn_enter:LabelButton,txt_timeRemaining,artClipfor material cost icon. Difficulty clicks dispatchDataEvent(SET_DIFFICULTY);btn_enterclick callsExternalInterface.call("OnAccept").createPortal(extendsShadowTowerCreatePortal, embedssymbol161) — concrete SWF-symbol binding forShadowTowerCreatePortal; setsbtn_entercomponent defaults.Listing(extendsMovieClip, embedssymbol11) — leaderboard row. Fields:friendIcon,txt_userName,txt_time,txt_rank. Two frame-label states (frames 2 and 3, bothstop()).node(extendsBaseButton, embedssymbol61) — floor selection button. 4-state (frames 1, 10, 20, 30). Expected children:selectedIcon,completedIcon.btnGreenWide(extendsLabelButton, embedssymbol31) — wide green action button. 4-state.Image(extendsArtClip, embedssymbol143) — generic art display slot.Equipped(extendsMovieClip, embedssymbol34) — equipped/selected badge stub.dummy— 100×100BitmapDataplaceholder.ShadowTower_flatimeline clips (5):btn_toggle_7(symbol154, difficulty toggle withselectionGlow, 2 frames),tab_39(symbol197, tab button withtextField, 2 frames),headerFrame_40(symbol202),keyHeaderFrame_4(symbol182),keysPanel_2(symbol189, 3×(amount+text) TextFields for shadow/lunar/eclipse keys, 2 frames).- Skin stubs (18): scroll arrow/thumb/track skins,
focusRectSkin,SlotBackground,SlotBackgroundLocked,SlotFrameHigh,SlotFrameNormal,SlotFrameMedium— all trivial MovieClip embeds.
Notable logic
- Difficulty dirty flag: changing difficulty while on the Leaderboard tab sets
displayDirty=trueand sends onlyGetLeaderboard(floor, difficulty). The game engine'sOnDifficultySelectedis only called when the user switches back to the Portal tab, preventing spurious server requests during leaderboard browsing. Any difficulty change also runsresetFloors(), and the engine re-sends the floors (setFloor) only in answer toOnDifficultySelected, so until the switch back the floor buttons carry no data. - Player row: the viewer's own result arrives separately through
addPlayerLeaderboardEntry(name, time, rank)into fixed fields under the list; on a board the player is not on, the engine sends no rank for it. - Leaderboard tie-rank handling:
addLeaderboardEntrytracks the previous entry's time and rank; if the new time matches, the rank display is blanked out to show a visual tie. - Console D-pad navigation:
moveHighlightuses two separate interaction domains.column < 1navigates the floornodebuttons (delta ±1 index).column == 1cycles difficulty toggle buttons, managingselectionGlowvisibility. - Key panel visibility: individual key type rows in
keysPanelare shown or hidden based on whether the game passes a non-zero count for shadow/lunar/eclipse keys, allowing the panel to collapse unused rows. - Test/preview mode: when not in Iggy,
configUIseeds 4 floors with dummy boss names/portraits and 15 leaderboard entries to allow offline layout inspection.