@@ -47,6 +47,14 @@ const WON_STATE = 'won';
4747const LOST_STATE = 'lost' ;
4848const DEBUG_OVERLAY_CONFIG = getRequiredLevel17OverlayStackConfig ( '1708' ) ;
4949
50+ function formatMissionStatusLabel ( gameState ) {
51+ return gameState === RUNNING_STATE
52+ ? 'Status: mission active.'
53+ : gameState === READY_STATE
54+ ? 'Status: waiting for deploy.'
55+ : `Status: ${ gameState } .` ;
56+ }
57+
5058function clamp ( value , min , max ) {
5159 return Math . max ( min , Math . min ( max , value ) ) ;
5260}
@@ -89,6 +97,7 @@ export default class RealGameplayMiniGameScene extends Scene {
8997 this . pickupBursts = [ ] ;
9098 this . hitFlash = 0 ;
9199 this . pickupFlash = 0 ;
100+ this . missionFeedState = null ;
92101
93102 this . resetMatch ( { toReady : true } ) ;
94103
@@ -161,6 +170,7 @@ export default class RealGameplayMiniGameScene extends Scene {
161170 this . addEvent ( 'Ready: press Space/Enter to deploy.' ) ;
162171 }
163172
173+ this . refreshMissionFeedState ( ) ;
164174 this . syncCamera ( ) ;
165175 }
166176
@@ -169,6 +179,7 @@ export default class RealGameplayMiniGameScene extends Scene {
169179 this . gameState = RUNNING_STATE ;
170180 this . resultMessage = 'Mission active. Collect cores and avoid sentries.' ;
171181 this . addEvent ( 'Mission started.' ) ;
182+ this . refreshMissionFeedState ( ) ;
172183 }
173184
174185 setCamera3D ( camera3D ) {
@@ -203,6 +214,26 @@ export default class RealGameplayMiniGameScene extends Scene {
203214 return getTabDebugOverlayActiveId ( this . tabDebugOverlays ) ;
204215 }
205216
217+ buildMissionFeedLiveLine ( ) {
218+ return `live=objective ${ this . score } /${ this . targetScore } hull=${ this . health } /${ this . maxHealth } t=${ this . timeLeft . toFixed ( 1 ) } s` ;
219+ }
220+
221+ refreshMissionFeedState ( ) {
222+ this . missionFeedState = {
223+ statusLabel : formatMissionStatusLabel ( this . gameState ) ,
224+ liveLine : this . buildMissionFeedLiveLine ( ) ,
225+ } ;
226+ return this . missionFeedState ;
227+ }
228+
229+ getMissionFeedStateSnapshot ( ) {
230+ const state = this . missionFeedState || this . refreshMissionFeedState ( ) ;
231+ return {
232+ statusLabel : state . statusLabel ,
233+ liveLine : state . liveLine ,
234+ } ;
235+ }
236+
206237 pushCollisionRow ( overlayId , kind , state , enabled = true ) {
207238 this . debugCollisionRows . push ( {
208239 overlayId,
@@ -364,25 +395,29 @@ export default class RealGameplayMiniGameScene extends Scene {
364395
365396 evaluateRoundState ( ) {
366397 if ( this . gameState !== RUNNING_STATE ) {
398+ this . refreshMissionFeedState ( ) ;
367399 return ;
368400 }
369401 if ( this . score >= this . targetScore ) {
370402 this . gameState = WON_STATE ;
371403 this . resultMessage = `Objective complete: ${ this . score } /${ this . targetScore } cores captured.` ;
372404 this . addEvent ( 'Mission complete.' ) ;
405+ this . refreshMissionFeedState ( ) ;
373406 return ;
374407 }
375408 if ( this . health <= 0 ) {
376409 this . gameState = LOST_STATE ;
377410 this . resultMessage = 'Mission failed: hull integrity depleted.' ;
378411 this . addEvent ( 'Mission failed: hull integrity depleted.' ) ;
412+ this . refreshMissionFeedState ( ) ;
379413 return ;
380414 }
381415 if ( this . timeLeft <= 0 ) {
382416 this . gameState = LOST_STATE ;
383417 this . resultMessage = 'Mission failed: timer expired before objective completion.' ;
384418 this . addEvent ( 'Mission failed: timer expired.' ) ;
385419 }
420+ this . refreshMissionFeedState ( ) ;
386421 }
387422
388423 updateFeedback ( dtSeconds ) {
@@ -437,6 +472,7 @@ export default class RealGameplayMiniGameScene extends Scene {
437472
438473 this . lastCollisionCount = this . debugCollisionRows . length ;
439474 this . updateFeedback ( dt ) ;
475+ this . refreshMissionFeedState ( ) ;
440476 this . syncCamera ( ) ;
441477 }
442478
@@ -542,11 +578,7 @@ export default class RealGameplayMiniGameScene extends Scene {
542578 renderer . drawRect ( viewport . x , viewport . y , viewport . width , viewport . height , `rgba(34, 211, 238, ${ alpha } )` ) ;
543579 }
544580
545- const missionStatus = this . gameState === RUNNING_STATE
546- ? 'Status: mission active.'
547- : this . gameState === READY_STATE
548- ? 'Status: waiting for deploy.'
549- : `Status: ${ this . gameState } .` ;
581+ const missionFeedState = this . getMissionFeedStateSnapshot ( ) ;
550582
551583 const debugStack = createBottomRightDebugPanelStack ( renderer ) ;
552584 this . debugOverlayStack = debugStack ;
@@ -564,7 +596,8 @@ export default class RealGameplayMiniGameScene extends Scene {
564596 } else if ( activeOverlayId === OVERLAY_MISSION_FEED ) {
565597 drawStackedDebugPanel ( renderer , debugStack , 326 , 160 , 'Mission Feed' , [
566598 ...this . eventFeed ,
567- missionStatus ,
599+ missionFeedState . liveLine ,
600+ missionFeedState . statusLabel ,
568601 ] ) ;
569602 } else if ( activeOverlayId === OVERLAY_MISSION_READY ) {
570603 const isWin = this . gameState === WON_STATE ;
0 commit comments