From 38a1d83cf284bf49d9eda0ed91c5bb62f35eded7 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Thu, 5 Jun 2025 04:07:22 +0300 Subject: [PATCH] fix(regression): B on gamepad was opening pause menu instead of start (default actions map conflict). Now start if clicked again closes all modals --- config.json | 2 +- src/controls.ts | 8 ++++++-- src/react/MobileTopButtons.tsx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index 755de450..bdfd28b2 100644 --- a/config.json +++ b/config.json @@ -66,7 +66,7 @@ "label": "" }, { - "action": "ui.back", + "action": "ui.pauseMenu", "actionHold": "", "label": "" } diff --git a/src/controls.ts b/src/controls.ts index bc620ad4..e270750e 100644 --- a/src/controls.ts +++ b/src/controls.ts @@ -237,9 +237,13 @@ const inModalCommand = (command: Command, pressed: boolean) => { if (pressed && !gamepadUiCursorState.display) return if (pressed) { - if (command === 'ui.back' || command === 'ui.pauseMenu') { + if (command === 'ui.back') { hideCurrentModal() } + if (command === 'ui.pauseMenu') { + // hide all modals + hideAllModals() + } if (command === 'ui.leftClick' || command === 'ui.rightClick') { // in percent const { x, y } = gamepadUiCursorState @@ -426,7 +430,6 @@ const onTriggerOrReleased = (command: Command, pressed: boolean) => { } } else if (stringStartsWith(command, 'ui')) { switch (command) { - case 'ui.back': case 'ui.pauseMenu': if (pressed) { if (activeModalStack.length) { @@ -436,6 +439,7 @@ const onTriggerOrReleased = (command: Command, pressed: boolean) => { } } break + case 'ui.back': case 'ui.toggleFullscreen': case 'ui.toggleMap': case 'ui.leftClick': diff --git a/src/react/MobileTopButtons.tsx b/src/react/MobileTopButtons.tsx index e8a82f77..f048af56 100644 --- a/src/react/MobileTopButtons.tsx +++ b/src/react/MobileTopButtons.tsx @@ -34,7 +34,7 @@ export default () => { switch (actionForStyle) { case 'general.chat': return styles['chat-btn'] - case 'ui.back': + case 'ui.pauseMenu': return styles['pause-btn'] case 'general.playersList': return styles['tab-btn']