@@ -22,6 +22,7 @@ import {
2222} from '/samples/phase-16/shared/threeDWireframe.js' ;
2323import {
2424 createTabDebugOverlayController ,
25+ getTabDebugOverlayActiveId ,
2526 getTabDebugOverlayStatusLabel ,
2627 isTabDebugOverlayActive ,
2728 setTabDebugOverlayCycleKey ,
@@ -198,6 +199,10 @@ export default class RealGameplayMiniGameScene extends Scene {
198199 return getTabDebugOverlayStatusLabel ( this . tabDebugOverlays ) ;
199200 }
200201
202+ getActiveDebugOverlayId ( ) {
203+ return getTabDebugOverlayActiveId ( this . tabDebugOverlays ) ;
204+ }
205+
201206 pushCollisionRow ( overlayId , kind , state , enabled = true ) {
202207 this . debugCollisionRows . push ( {
203208 overlayId,
@@ -545,8 +550,8 @@ export default class RealGameplayMiniGameScene extends Scene {
545550
546551 const debugStack = createBottomRightDebugPanelStack ( renderer ) ;
547552 this . debugOverlayStack = debugStack ;
548-
549- if ( this . isDebugOverlayActive ( OVERLAY_UI_LAYER ) ) {
553+ const activeOverlayId = this . getActiveDebugOverlayId ( ) ;
554+ if ( activeOverlayId === OVERLAY_UI_LAYER ) {
550555 drawStackedDebugPanel ( renderer , debugStack , 326 , 174 , 'UI Layer' , [
551556 `state=${ this . gameState . toUpperCase ( ) } ` ,
552557 `objective=${ this . score } /${ this . targetScore } cores` ,
@@ -556,16 +561,12 @@ export default class RealGameplayMiniGameScene extends Scene {
556561 `overlayCycle=G/Shift+G` ,
557562 'controls=W/A/S/D move | Q/E yaw' ,
558563 ] ) ;
559- }
560-
561- if ( this . isDebugOverlayActive ( OVERLAY_MISSION_FEED ) ) {
564+ } else if ( activeOverlayId === OVERLAY_MISSION_FEED ) {
562565 drawStackedDebugPanel ( renderer , debugStack , 326 , 160 , 'Mission Feed' , [
563566 ...this . eventFeed ,
564567 missionStatus ,
565568 ] ) ;
566- }
567-
568- if ( this . isDebugOverlayActive ( OVERLAY_MISSION_READY ) ) {
569+ } else if ( activeOverlayId === OVERLAY_MISSION_READY ) {
569570 const isWin = this . gameState === WON_STATE ;
570571 const outcomeLabel = this . gameState === READY_STATE
571572 ? 'Press Space or Enter to deploy.'
@@ -578,9 +579,7 @@ export default class RealGameplayMiniGameScene extends Scene {
578579 isWin ? 'result=mission complete' : this . gameState === LOST_STATE ? 'result=mission failed' : 'result=pending' ,
579580 'restart=R after mission outcome' ,
580581 ] ) ;
581- }
582-
583- if ( this . isDebugOverlayActive ( OVERLAY_MINI_GAME_RUNTIME ) ) {
582+ } else if ( activeOverlayId === OVERLAY_MINI_GAME_RUNTIME ) {
584583 drawStackedDebugPanel ( renderer , debugStack , 300 , 120 , 'Mini-Game Runtime' , [
585584 `Entities: obstacles=${ this . obstacles . length } sentries=${ this . enemies . length } ` ,
586585 `Remaining cores: ${ this . cores . filter ( ( core ) => ! core . collected ) . length } ` ,
0 commit comments