diff options
author | Filippos Karapetis | 2015-12-28 01:58:17 +0200 |
---|---|---|
committer | Filippos Karapetis | 2015-12-28 01:59:17 +0200 |
commit | f6e42a72826afd2bd796e830afe48c66034d24f0 (patch) | |
tree | b0d05121109064801868387452eb16aa0dc1fa3c | |
parent | c9bda09bc0900aac6d1cd96cd3f69b6a1761df70 (diff) | |
download | scummvm-rg350-f6e42a72826afd2bd796e830afe48c66034d24f0.tar.gz scummvm-rg350-f6e42a72826afd2bd796e830afe48c66034d24f0.tar.bz2 scummvm-rg350-f6e42a72826afd2bd796e830afe48c66034d24f0.zip |
LAB: Simulate events by setting an unused key
-rw-r--r-- | engines/lab/console.cpp | 3 | ||||
-rw-r--r-- | engines/lab/eventman.cpp | 5 | ||||
-rw-r--r-- | engines/lab/eventman.h | 4 | ||||
-rw-r--r-- | engines/lab/lab.cpp | 3 |
4 files changed, 11 insertions, 4 deletions
diff --git a/engines/lab/console.cpp b/engines/lab/console.cpp index 35e29f2920..217dc28579 100644 --- a/engines/lab/console.cpp +++ b/engines/lab/console.cpp @@ -53,7 +53,8 @@ bool Console::Cmd_Scene(int argc, const char **argv) { _vm->_closeDataPtr = nullptr; _vm->_mainDisplay = true; _vm->_followingCrumbs = false; - _vm->_event->simulateLeftClick(); + _vm->_event->simulateEvent(); + _vm->_graphics->_longWinInFront = false; return false; } diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp index 333cedd749..a94ddbf16b 100644 --- a/engines/lab/eventman.cpp +++ b/engines/lab/eventman.cpp @@ -205,4 +205,9 @@ Common::Point EventManager::updateAndGetMousePos() { return _mousePos; } +void EventManager::simulateEvent() { + // Simulate an event by setting an unused key + _keyPressed = Common::KeyState(Common::KEYCODE_SEMICOLON); +} + } // End of namespace Lab diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h index c282f5106f..37745292fa 100644 --- a/engines/lab/eventman.h +++ b/engines/lab/eventman.h @@ -123,10 +123,10 @@ public: Common::Point updateAndGetMousePos(); /** - * Simulates a left click for the game main loop, when a game is + * Simulates an event for the game main loop, when a game is * loaded or when the user teleports to a scene */ - void simulateLeftClick() { _leftClick = true; } + void simulateEvent(); }; } // End of namespace Lab diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index 905f09c106..47b864d98b 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -249,7 +249,8 @@ Common::Error LabEngine::loadGameState(int slot) { _closeDataPtr = nullptr; _mainDisplay = true; _followingCrumbs = false; - _event->simulateLeftClick(); + _event->simulateEvent(); + _graphics->_longWinInFront = false; return (result) ? Common::kNoError : Common::kUserCanceled; } |