From 8da57eddabda9500b6998fff90eabc0dc9e51b1f Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 11 Apr 2026 12:19:05 +0200 Subject: [PATCH] Add PlayerStartInputBindingOverrides interface and update createPlayerStartEntity function --- src/entities/entity-instances.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/entities/entity-instances.ts b/src/entities/entity-instances.ts index 812dd081..59555c05 100644 --- a/src/entities/entity-instances.ts +++ b/src/entities/entity-instances.ts @@ -101,6 +101,11 @@ export interface PlayerStartInputBindings { gamepad: PlayerStartGamepadBindings; } +export interface PlayerStartInputBindingOverrides { + keyboard?: Partial; + gamepad?: Partial; +} + export interface PlayerStartColliderSettings { mode: PlayerStartColliderMode; eyeHeight: number; @@ -366,10 +371,7 @@ export function clonePlayerStartInputBindings( } export function createPlayerStartInputBindings( - overrides: { - keyboard?: Partial; - gamepad?: Partial; - } = {} + overrides: PlayerStartInputBindingOverrides = {} ): PlayerStartInputBindings { const keyboard: PlayerStartKeyboardBindings = { moveForward: @@ -621,15 +623,12 @@ export function createPlayerStartEntity( overrides: Partial< Pick< PlayerStartEntity, - | "id" - | "name" - | "position" - | "yawDegrees" - | "navigationMode" - | "inputBindings" - | "collider" + "id" | "name" | "position" | "yawDegrees" | "navigationMode" > - > = {} + > & { + inputBindings?: PlayerStartInputBindingOverrides; + collider?: Partial; + } = {} ): PlayerStartEntity { const position = cloneVec3(overrides.position ?? DEFAULT_PLAYER_START_POSITION); const yawDegrees = overrides.yawDegrees ?? DEFAULT_PLAYER_START_YAW_DEGREES;