fix(regression): B on gamepad was opening pause menu instead of start (default actions map conflict). Now start if clicked again closes all modals

This commit is contained in:
Vitaly Turovsky 2025-06-05 04:07:22 +03:00
commit 38a1d83cf2
3 changed files with 8 additions and 4 deletions

View file

@ -66,7 +66,7 @@
"label": ""
},
{
"action": "ui.back",
"action": "ui.pauseMenu",
"actionHold": "",
"label": ""
}

View file

@ -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':

View file

@ -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']