BURIED: Clear _controlDown flag on GUI windows opening

Prevents being stuck in fast mode, fixes TRAC #13584
This commit is contained in:
Walter Agazzi 2022-12-29 16:25:40 +01:00 committed by Filippos Karapetis
parent c05a8a71c6
commit 88291f358f
3 changed files with 11 additions and 2 deletions

View File

@ -504,6 +504,10 @@ void BuriedEngine::pollForEvents() {
window->postMessage(new RButtonUpMessage(window->convertPointToLocal(event.mouse), 0));
break;
}
case Common::EVENT_MAINMENU: {
((FrameWindow *)_mainWindow)->_controlDown = false;
break;
}
default:
break;
}

View File

@ -311,6 +311,7 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) {
case Common::KEYCODE_s:
if ((key.flags & Common::KBD_CTRL) && cloakingDisabled && !interfaceMenuActive) {
_vm->handleSaveDialog();
((FrameWindow *)_vm->_mainWindow)->_controlDown = false;
} else if (_sceneViewWindow)
_sceneViewWindow->sendMessage(new KeyUpMessage(key, flags));
break;
@ -318,13 +319,15 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) {
case Common::KEYCODE_l:
if ((key.flags & Common::KBD_CTRL) && cloakingDisabled && !interfaceMenuActive) {
_vm->handleRestoreDialog();
((FrameWindow *)_vm->_mainWindow)->_controlDown = false;
} else if (_sceneViewWindow)
_sceneViewWindow->sendMessage(new KeyUpMessage(key, flags));
break;
case Common::KEYCODE_p:
if ((key.flags & Common::KBD_CTRL) && cloakingDisabled && !interfaceMenuActive)
if ((key.flags & Common::KBD_CTRL) && cloakingDisabled && !interfaceMenuActive) {
_vm->pauseGame();
else if (_sceneViewWindow)
((FrameWindow *)_vm->_mainWindow)->_controlDown = false;
} else if (_sceneViewWindow)
_sceneViewWindow->sendMessage(new KeyUpMessage(key, flags));
break;
default:

View File

@ -2296,6 +2296,7 @@ void SceneViewWindow::onKeyUp(const Common::KeyState &key, uint flags) {
// Return to main menu
if (_vm->runQuitDialog())
((FrameWindow *)_vm->_mainWindow)->showMainMenu();
((FrameWindow *)_vm->_mainWindow)->_controlDown = false;
return;
}
break;
@ -2304,6 +2305,7 @@ void SceneViewWindow::onKeyUp(const Common::KeyState &key, uint flags) {
// Current points (ScummVM enhancement - Agent evaluation
// from death screens)
_vm->showPoints();
((FrameWindow *)_vm->_mainWindow)->_controlDown = false;
return;
}
break;