@@ -8,6 +8,7 @@ import assert from 'node:assert/strict';
88import RealGameplayMiniGameScene from '../../samples/phase-17/1708/RealGameplayMiniGameScene.js' ;
99import {
1010 getOverlayCycleInputCodes ,
11+ getOverlayRuntimeCycleInputCodes ,
1112 getOverlayRuntimeToggleInputCodes ,
1213} from '../../samples/phase-17/shared/overlayCycleInput.js' ;
1314import { resetTabDebugOverlayPersistenceForTests } from '../../samples/phase-17/shared/tabDebugOverlayCycle.js' ;
@@ -71,7 +72,15 @@ function pressOverlayRuntimeToggle(scene) {
7172 scene . step3DPhysics ( 0.02 , { input : makeInput ( [ ] ) } ) ;
7273}
7374
75+ function pressOverlayRuntimeCycle ( scene ) {
76+ scene . step3DPhysics ( 0.02 , { input : makeInput ( getOverlayRuntimeCycleInputCodes ( ) ) } ) ;
77+ scene . step3DPhysics ( 0.02 , { input : makeInput ( [ ] ) } ) ;
78+ }
79+
7480function assertGameplayOverlayRuntimeHooksAreNonBlocking ( ) {
81+ assert . equal ( getOverlayRuntimeToggleInputCodes ( ) . includes ( 'Tab' ) , false , 'Runtime overlay toggle mapping must not use Tab.' ) ;
82+ assert . equal ( getOverlayRuntimeCycleInputCodes ( ) . includes ( 'Tab' ) , false , 'Runtime overlay cycle mapping must not use Tab.' ) ;
83+
7584 const scene = new RealGameplayMiniGameScene ( ) ;
7685 scene . setCamera3D ( createCameraStub ( ) ) ;
7786
@@ -123,7 +132,11 @@ function assertGameplayOverlayRuntimeHooksAreNonBlocking() {
123132 scene . render ( missionFeedRenderer ) ;
124133 assert . equal ( missionFeedRenderer . texts . some ( ( text ) => text . includes ( 'Mission Feed' ) ) , true , 'Debug overlay cycle behavior should remain unchanged.' ) ;
125134 scene . step3DPhysics ( 0.05 , { input : makeInput ( [ ] ) } ) ;
126- assert . equal ( counters . bStep > beforeCycleBStep , true , 'Gameplay overlay runtime cycle control should switch active runtime extension.' ) ;
135+ assert . equal ( counters . bStep , beforeCycleBStep , 'Plain debug overlay cycle should not switch gameplay runtime overlay extension.' ) ;
136+
137+ pressOverlayRuntimeCycle ( scene ) ;
138+ scene . step3DPhysics ( 0.05 , { input : makeInput ( [ ] ) } ) ;
139+ assert . equal ( counters . bStep > beforeCycleBStep , true , 'Explicit runtime overlay cycle control should switch active runtime extension.' ) ;
127140
128141 const beforeHideStep = counters . aStep + counters . bStep ;
129142 pressOverlayRuntimeToggle ( scene ) ;
@@ -134,6 +147,10 @@ function assertGameplayOverlayRuntimeHooksAreNonBlocking() {
134147 scene . step3DPhysics ( 0.05 , { input : makeInput ( [ ] ) } ) ;
135148 assert . equal ( counters . aStep + counters . bStep > beforeHideStep , true , 'Runtime overlay toggle should restore runtime overlay execution.' ) ;
136149
150+ const beforeMoveWithRuntimeControl = scene . player . x ;
151+ scene . step3DPhysics ( 0.2 , { input : makeInput ( [ 'KeyD' , ...getOverlayRuntimeCycleInputCodes ( ) ] ) } ) ;
152+ assert . equal ( scene . player . x > beforeMoveWithRuntimeControl , true , 'Gameplay movement input should remain primary during explicit runtime overlay control actions.' ) ;
153+
137154 scene . setOverlayGameplayRuntimeExtensions ( [
138155 {
139156 overlayId : 'mission-feed' ,
0 commit comments