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:
parent
314ddf7215
commit
38a1d83cf2
3 changed files with 8 additions and 4 deletions
|
|
@ -66,7 +66,7 @@
|
|||
"label": ""
|
||||
},
|
||||
{
|
||||
"action": "ui.back",
|
||||
"action": "ui.pauseMenu",
|
||||
"actionHold": "",
|
||||
"label": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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':
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue