Add pause functionality validation in scene document

This commit is contained in:
2026-04-14 22:39:25 +02:00
parent f4491e13a5
commit fe4cdad1dc
2 changed files with 32 additions and 0 deletions

View File

@@ -239,6 +239,7 @@ import {
PLAYER_START_GAMEPAD_BINDINGS,
PLAYER_START_LOCOMOTION_ACTIONS,
PLAYER_START_MOVEMENT_ACTIONS,
PLAYER_START_SYSTEM_ACTIONS,
PLAYER_START_NAVIGATION_MODES,
DEFAULT_SPOT_LIGHT_ANGLE_DEGREES,
DEFAULT_SPOT_LIGHT_COLOR_HEX,
@@ -279,6 +280,7 @@ import {
type PlayerStartKeyboardBindingCode,
type PlayerStartLocomotionAction,
type PlayerStartMovementAction,
type PlayerStartSystemAction,
type PlayerStartMovementTemplate,
type PlayerStartNavigationMode,
type EntityInstance,
@@ -543,6 +545,8 @@ function getPlayerStartInputActionLabel(
return "Sprint";
case "crouch":
return "Crouch";
case "pauseTime":
return "Pause";
}
}
@@ -616,6 +620,8 @@ function formatPlayerStartGamepadActionBindingLabel(
return "West Button";
case "buttonNorth":
return "North Button";
case "buttonMenu":
return "Menu / Start";
case "leftShoulder":
return "Left Shoulder";
case "rightShoulder":

View File

@@ -2024,6 +2024,19 @@ function validatePlayerStartEntity(
);
}
if (
!isPlayerStartKeyboardBindingCode(entity.inputBindings?.keyboard.pauseTime)
) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-player-start-pause-keyboard-binding",
"Player Start pause keyboard binding must be a supported key code.",
`${path}.inputBindings.keyboard.pauseTime`
)
);
}
if (!isPlayerStartGamepadBinding(entity.inputBindings?.gamepad.moveForward)) {
diagnostics.push(
createDiagnostic(
@@ -2107,6 +2120,19 @@ function validatePlayerStartEntity(
);
}
if (
!isPlayerStartGamepadActionBinding(entity.inputBindings?.gamepad.pauseTime)
) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-player-start-pause-gamepad-binding",
"Player Start pause gamepad binding must be a supported standard-gamepad action input.",
`${path}.inputBindings.gamepad.pauseTime`
)
);
}
if (
!isPlayerStartGamepadCameraLookBinding(
entity.inputBindings?.gamepad.cameraLook