pvphud.swf
The heads-up display overlay shown during PvP matches in Trove. It displays a countdown timer, team scores, a personal score panel, an engine-written counter with its person and red-cross icons, a broadcast message area, and a scrolling message queue for kill-feed or event notifications.
Document/main class: PVPHUD (extends _kiwi.Core.UIComponent)
SWF-specific classes: 5 (excluding framework; 2 are PVPHUD_fla timeline symbols)
Main class: PVPHUD
PVPHUD extends UIComponent and acts as the top-level controller for the PvP HUD. Its constructor calls reset() immediately. All Iggy callbacks are registered inside configUI() (framework lifecycle, called on first render) rather than the constructor, ensuring the stage is available before callbacks are wired.
The class manages two score display modes — SCORE_INTEGER (0) and SCORE_TIME (1) — via scoreType and scoreIcon state fields, though the mode is stored but not yet visually distinguished beyond icon frame selection.
Public methods
reset() : void— clears all text fields, resetstimeRemainingcolor to white (0xFFFFFF), hidesscoreContainer,teammateDeadIcon,killCounterIcon; resetsscoreTypeandscoreIconto −1.setMessage(text:String) : void— setsbroadcastContainer.broadcastText.htmlTextwith full alpha.addImmediateMessage(text:String) : void— clears the message queue and directly setsmessageQueue.textfield.htmlText; bypasses queue ordering.updateCountdown(seconds:int) : void— displays the countdown integer inbroadcastText, then launches threeIggyTweens onbroadcastContainer(scaleX, scaleY grow from2+(10−n)/2→1; alpha fade 1→0 over 1 s); also callsmessageQueue.reset(). Scale start size varies with remaining time, making later countdown ticks appear larger.prepareForBattle() : void— clears the timer text and callssetMessage(IggyFunctions.translate("$PVP_Prepare")).beginMatch() : void— callssetMessage(IggyFunctions.translate("$PVP_Begin")), fadesbroadcastContaineralpha to 0 over 2 s viaIggyTween, resets message queue.updateTeamScore(teamIdx:int, color:uint, score:int, maxScore:int) : void— looks up the childPVPScorenamed"team" + teamIdxinsidescoreContainer(onlyteam1andteam2exist); callsinit(maxScore, color)thenupdateScore(score).initnever readsmaxScoreand applies the colour only on its first call.updatePersonalScore(current:Number, max:Number) : void— ifmax == 0showsint(current), otherwise shows"int(current)/int(max)"inpersonalScoreContainer.score.setPersonalScoreType(type:int) : void— storesscoreType; no visual change beyond caching.setPersonalScoreIcon(icon:int) : void— sendspersonalScoreContainer.iconto frameicon + 2. The icon clip (chid 17) is blank on frame 1 (thereset()state), a gold coin on frame 2 and a red ring on frame 3, so0= coin and1= ring.updateTick(timeStr:String, msRemaining:uint, counting:Boolean) : void— always makesscoreContainervisible and writestimeStrtotimeRemaining.textField. Only when the third argument is true and the text has changed with time left: a 1.5→1 scale pulse under 10 s, red0xCC0033under 30 s, yellow0xFFCC00under 60 s; an unchanged string (or zero time) resetstimeRemaining.alphato 1 instead.
Key fields
SCORE_INTEGER : int = 0/SCORE_TIME : int = 1— score-mode constants.timeRemaining : MovieClip— timer display; childtextFieldreceives the formatted time string.scoreContainer : MovieClip— holds twoPVPScorechildren named"team1"and"team2".broadcastContainer : MovieClip— center-screen message area; childbroadcastText(TextField) shows countdown/phase messages.personalScoreContainer : MovieClip— holdsicon(MovieClip, multi-frame) andscore(TextField); its own frames are labelledcoinandrings, and it stays oncoin.teammateDeadIcon : MovieClip— a red-cross bitmap (chid 27); shown/hidden by the engine, which sets it by name (reset hides it).killCounterIcon : MovieClip— a person-figure bitmap (chid 24) besidecounterText; shown/hidden by the engine, which sets it by name (reset hides it).counterText : TextField— numeric count text written by the engine by name; the SWF only clears it inreset().messageQueue : MessageQueue— framework scrolling message queue for kill-feed entries.dropShadowFilter : DropShadowFilter— shared drop-shadow (offset 2, 45°, low quality) applied totimeRemaining.
Runtime dependencies & integration
ExternalInterface callbacks registered (Iggy → Flash):
| Callback | Method |
|---|---|
reset |
reset |
setMessage |
setMessage |
updateCountdown |
updateCountdown |
prepareForBattle |
prepareForBattle |
beginMatch |
beginMatch |
updateTick |
updateTick |
updateTeamScore |
updateTeamScore |
updatePersonalScore |
updatePersonalScore |
setPersonalScoreType |
setPersonalScoreType |
setPersonalScoreIcon |
setPersonalScoreIcon |
addMessage |
messageQueue.addMessage (delegated directly) |
addImmediateMessage |
addImmediateMessage |
IggyFunctions usage:
IggyFunctions.translate("$PVP_Prepare")— localisation key for pre-battle message.IggyFunctions.translate("$PVP_Begin")— localisation key for match-start message.IggyFunctions.inIggy— gates all callback registration.
IggyTween usage:
- Countdown scale pulse on
broadcastContainer(scaleX, scaleY, alpha). - Per-tick pulse on
timeRemaining(scaleX, scaleY) when under 10 s. - Match-start alpha fade on
broadcastContainer.
Other game-specific classes
PVPScore—[Embed symbol="symbol7"]MovieClip; displays a single team's score with animated scale-bounce and glow-filter flash on score change (Strong easeIn out, Elastic easeOut back). Holdsscalar(MovieClip withtextField) and appliesGlowFilter/DropShadowFilterper frame viaENTER_FRAME. Color is set from thecolorargument shifted right 8 bits (>> 8).messageQueue—[Embed symbol="symbol3"]thin wrapper extending_kiwi.Controls.MessageQueue; no added logic.
PVPHUD_fla timeline symbols:
PVPHUD_fla.minigameIcon_7—[Embed symbol="symbol17"]multi-frame icon MovieClip; frame 1 stops.PVPHUD_fla.miniGameScores_6—[Embed symbol="symbol20"]personal-score container; holdsicon(MovieClip) andscore(TextField); frame 1 stops.
Notable logic
- Countdown scale sizing —
updateCountdownderives the tween start scale as2 + (10 − n) / 2, so the number "10" appears at scale 2 and the number "1" appears at scale 6.5, creating an urgency ramp. - Timer color escalation —
updateTickapplies three discrete thresholds: white (> 60 s, set byreset()),0xFFCC00yellow (< 60 s),0xCC0033red (< 30 s), then a scale pulse on every change under 10 s (the red stays). - Score color packing — team color arrives as RGBA in one uint and is shifted right 8 bits before being applied to
GlowFilter.colorandtextField.textColor, stripping the low alpha byte. - Queue bypass —
addImmediateMessageclears the queue and writes directly to the textfield, useful for critical single-line notifications that should not be delayed by queued messages.