Add interact binding support for player start inputs (keyboard, gamepad, mouse)
This commit is contained in:
@@ -19,6 +19,7 @@ export interface PlayerStartActionInputState
|
||||
jump: number;
|
||||
sprint: number;
|
||||
crouch: number;
|
||||
interact: number;
|
||||
pauseTime: number;
|
||||
}
|
||||
|
||||
@@ -292,6 +293,10 @@ export function resolvePlayerStartActionInputs(
|
||||
pressedKeys.has(bindings.keyboard.crouch) ? 1 : 0,
|
||||
readGamepadActionBindingStrength(gamepads, bindings.gamepad.crouch)
|
||||
),
|
||||
interact: Math.max(
|
||||
pressedKeys.has(bindings.keyboard.interact) ? 1 : 0,
|
||||
readGamepadActionBindingStrength(gamepads, bindings.gamepad.interact)
|
||||
),
|
||||
pauseTime: Math.max(
|
||||
pressedKeys.has(bindings.keyboard.pauseTime) ? 1 : 0,
|
||||
readGamepadActionBindingStrength(gamepads, bindings.gamepad.pauseTime)
|
||||
@@ -308,6 +313,15 @@ export function resolvePlayerStartPauseInput(
|
||||
.pauseTime;
|
||||
}
|
||||
|
||||
export function resolvePlayerStartInteractInput(
|
||||
pressedKeys: ReadonlySet<string>,
|
||||
bindings: PlayerStartInputBindings,
|
||||
gamepads: ArrayLike<Gamepad | null> | null | undefined = getAvailableGamepads()
|
||||
): number {
|
||||
return resolvePlayerStartActionInputs(pressedKeys, bindings, gamepads)
|
||||
.interact;
|
||||
}
|
||||
|
||||
export function resolveDefaultTargetCycleInput(
|
||||
gamepads: ArrayLike<Gamepad | null> | null | undefined = getAvailableGamepads()
|
||||
): number {
|
||||
|
||||
Reference in New Issue
Block a user