terraformoverview.swf
Shows a countdown overlay during a Terraformer activation sequence in Trove — the warning everyone standing in a zone gets when that zone is about to be terraformed (a club world's biome change) — displaying a live ticking timer and cancellation instructions. The countdown is driven by a Flash
Timercalibrated againstgetTimer()for drift correction, and is started by a game-engine callback that passes the initial number of seconds remaining.
Document/main class: TerraformOverview (extends _kiwi.Core.UIComponent)
SWF-specific classes: 1
Main class: TerraformOverview
TerraformOverview is the document class and the only game-specific class in this SWF. The constructor registers two ExternalInterface callbacks (gated on IggyFunctions.inIggy) and calls setupTranslation(). The countdown timer is not started at construction; it starts only when the engine calls startCountdown. Each tick recomputes elapsed time from the original getTimer() snapshot rather than simply decrementing, preventing drift.
Public methods
startCountdown(param1:Number) : void— Sent once per warning; no further countdown update, cancel or hide callback follows. Storesparam1asinitialSecondsLeft, recordscountdownStartMillisecs = getTimer(), updates the display immediately, creates a repeating 1-secondTimer, and starts it.setCancelInstructions(param1:String) : void(private) — SetscancelTextField.text = param1.
Key fields
countdownStartMillisecs : int— Millisecond timestamp (fromgetTimer()) captured whenstartCountdownis called; used as the reference point for elapsed-time calculation.initialSecondsLeft : Number(default 0) — The total seconds passed tostartCountdown; kept for the elapsed-time formula.timer : Timer(default null) — A repeatingTimer(1000, 0)(fires every second, indefinitely) that drivesonTimerInterval.countdownText : TextField— Displays the formatted countdown string. Authored at (2, 20), 802 wide, centred, 26 pt white, with initial text$TerraformFlyoverWarning("This Zone Is About To Be Terraformed.") untilstartCountdownreplaces it.cancelTextField : TextField— Displays the cancel/abort instruction text set by the engine. Authored at (163, 77), 472 wide, centred, 20 pt yellow (#FFFF66), with initial text$TerraformCancel("Press [HK:Cancel] To Cancel.").
Runtime dependencies & integration
IggyFunctions.inIggy— Guards callback registration.- ExternalInterface callbacks registered:
"startCountdown"→startCountdown(Number)— begins the visible timer."setCancelInstructions"→setCancelInstructions(String)— sets cancellation hint text.
IggyFunctions.translatekey used:"$TerraformCountdownText"("This Zone Will Be Terraformed In {seconds} Second(s)") — localizable string template; the literal{seconds}placeholder is replaced withint(secondsLeft)viaString.replace.
TimerEvent.TIMER— listened on the internalTimerinstance.- No outbound ExternalInterface calls; no frame scripts.
- Timeline: one frame on an 834 × 130 stage: a rounded translucent grey panel (depth 1),
countdownText,cancelTextField, and abtn_console_easticon imported fromSharedLibraryControllerand placed off-stage at x 854 — the class does not declare it. Most of the file is an embedded Open Sans Semibold.
Other game-specific classes
None beyond TerraformOverview.
Notable logic
- The countdown uses a drift-correcting formula:
remaining = initialSecondsLeft - (getTimer() - countdownStartMillisecs) / 1000. This ensures the displayed value stays accurate even if Flash timer callbacks are delayed by frame rate drops. - The timer is configured with
repeatCount = 0(infinite) and stops itself whenremaining <= 0. There is no ExternalInterface call on expiry — the engine removes the window on its own schedule, and does not always do so the moment the count reaches zero. - Seconds are truncated to integer via
int(param1)before substitution, so the display counts down in whole seconds.