Add support for system actions in player input bindings
This commit is contained in:
@@ -6306,7 +6306,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
};
|
||||
|
||||
const handlePlayerStartGamepadActionBindingChange = (
|
||||
action: PlayerStartLocomotionAction,
|
||||
action: PlayerStartLocomotionAction | PlayerStartSystemAction,
|
||||
nextBinding: PlayerStartGamepadActionBinding
|
||||
) => {
|
||||
const nextBindings = createPlayerStartInputBindings({
|
||||
@@ -15935,6 +15935,67 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
</div>
|
||||
))}
|
||||
|
||||
{PLAYER_START_SYSTEM_ACTIONS.map((action) => (
|
||||
<div
|
||||
key={action}
|
||||
className="vector-inputs vector-inputs--two"
|
||||
>
|
||||
<label className="form-field">
|
||||
<span className="label">
|
||||
{getPlayerStartInputActionLabel(action)} Key
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
data-testid={`player-start-keyboard-binding-${action}`}
|
||||
className="toolbar__button"
|
||||
onClick={() => {
|
||||
setPlayerStartKeyboardCaptureAction(action);
|
||||
setStatusMessage(
|
||||
`Press any key for ${getPlayerStartInputActionLabel(action)}. Press Escape to cancel.`
|
||||
);
|
||||
}}
|
||||
>
|
||||
{playerStartKeyboardCaptureAction === action
|
||||
? "Press Any Key..."
|
||||
: formatPlayerStartKeyboardBindingLabel(
|
||||
playerStartInputBindingsDraft.keyboard[
|
||||
action
|
||||
]
|
||||
)}
|
||||
</button>
|
||||
</label>
|
||||
<label className="form-field">
|
||||
<span className="label">
|
||||
{getPlayerStartInputActionLabel(action)} Pad
|
||||
</span>
|
||||
<select
|
||||
data-testid={`player-start-gamepad-binding-${action}`}
|
||||
className="select-input"
|
||||
value={
|
||||
playerStartInputBindingsDraft.gamepad[action]
|
||||
}
|
||||
onChange={(event) =>
|
||||
handlePlayerStartGamepadActionBindingChange(
|
||||
action,
|
||||
event.currentTarget
|
||||
.value as PlayerStartGamepadActionBinding
|
||||
)
|
||||
}
|
||||
>
|
||||
{PLAYER_START_GAMEPAD_ACTION_BINDINGS.map(
|
||||
(binding) => (
|
||||
<option key={binding} value={binding}>
|
||||
{formatPlayerStartGamepadActionBindingLabel(
|
||||
binding
|
||||
)}
|
||||
</option>
|
||||
)
|
||||
)}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<label className="form-field">
|
||||
<span className="label">Camera Pad</span>
|
||||
<select
|
||||
@@ -15964,8 +16025,9 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
|
||||
<div className="material-summary">
|
||||
These bindings feed the same typed movement,
|
||||
locomotion, and camera actions in First Person and
|
||||
Third Person. Mouse look stays available as before.
|
||||
locomotion, system, and camera actions in First
|
||||
Person and Third Person. Mouse look stays available
|
||||
as before.
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user