Implement player start key binding capture and refine key handling logic
This commit is contained in:
@@ -3447,7 +3447,10 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.code === "Escape") {
|
||||
if (
|
||||
event.code === "Escape" &&
|
||||
playerStartKeyboardCaptureAction !== "clearTarget"
|
||||
) {
|
||||
setPlayerStartKeyboardCaptureAction(null);
|
||||
setStatusMessage("Cancelled Player Start key capture.");
|
||||
return;
|
||||
@@ -8925,6 +8928,10 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
navigationMode,
|
||||
interactionReachMeters,
|
||||
interactionAngleDegrees,
|
||||
allowLookInputTargetSwitch:
|
||||
playerStartAllowLookInputTargetSwitchDraft,
|
||||
targetButtonCyclesActiveTarget:
|
||||
playerStartTargetButtonCyclesActiveTargetDraft,
|
||||
movementTemplate,
|
||||
inputBindings,
|
||||
collider: {
|
||||
@@ -8958,6 +8965,21 @@ export function App({ store, initialStatusMessage }: AppProps) {
|
||||
}
|
||||
};
|
||||
|
||||
const beginPlayerStartKeyboardCapture = (action: PlayerStartInputAction) => {
|
||||
if (playerStartKeyboardCaptureAction === action) {
|
||||
setPlayerStartKeyboardCaptureAction(null);
|
||||
setStatusMessage("Cancelled Player Start key capture.");
|
||||
return;
|
||||
}
|
||||
|
||||
setPlayerStartKeyboardCaptureAction(action);
|
||||
setStatusMessage(
|
||||
action === "clearTarget"
|
||||
? `Press any key or mouse button for ${getPlayerStartInputActionLabel(action)}. Click the binding button again to cancel.`
|
||||
: `Press any key or mouse button for ${getPlayerStartInputActionLabel(action)}. Press Escape to cancel.`
|
||||
);
|
||||
};
|
||||
|
||||
const handlePlayerStartKeyboardBindingChange = (
|
||||
action: PlayerStartInputAction,
|
||||
nextCode: PlayerStartKeyboardBindingCode
|
||||
|
||||
Reference in New Issue
Block a user