diff options
author | Torbjörn Andersson | 2014-01-06 14:47:17 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2014-01-06 14:47:17 +0100 |
commit | bb4a6c28996511b9c57465807276d8d8fb624cd4 (patch) | |
tree | 0105df74aa8d8ff5fcebc4578517915b0bb9365e | |
parent | ab17bfb3d64a175dd5b6586b09789d784baa0b19 (diff) | |
download | scummvm-rg350-bb4a6c28996511b9c57465807276d8d8fb624cd4.tar.gz scummvm-rg350-bb4a6c28996511b9c57465807276d8d8fb624cd4.tar.bz2 scummvm-rg350-bb4a6c28996511b9c57465807276d8d8fb624cd4.zip |
NEVERHOOD: Add mousewheel support to original save/load dialogs
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 12 | ||||
-rw-r--r-- | engines/neverhood/gamemodule.h | 2 | ||||
-rw-r--r-- | engines/neverhood/menumodule.cpp | 6 | ||||
-rw-r--r-- | engines/neverhood/messages.h | 6 | ||||
-rw-r--r-- | engines/neverhood/neverhood.cpp | 6 |
5 files changed, 31 insertions, 1 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 45f9465a11..12703d9f39 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -119,6 +119,18 @@ void GameModule::handleMouseUp(int16 x, int16 y) { } } +void GameModule::handleWheelUp() { + if (_childObject) { + sendMessage(_childObject, NM_MOUSE_WHEELUP, 0); + } +} + +void GameModule::handleWheelDown() { + if (_childObject) { + sendMessage(_childObject, NM_MOUSE_WHEELDOWN, 0); + } +} + void GameModule::handleSpaceKey() { if (_childObject) { debug(2, "GameModule::handleSpaceKey()"); diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h index 2f2fecf463..198f8f6715 100644 --- a/engines/neverhood/gamemodule.h +++ b/engines/neverhood/gamemodule.h @@ -40,6 +40,8 @@ public: void handleMouseMove(int16 x, int16 y); void handleMouseDown(int16 x, int16 y); void handleMouseUp(int16 x, int16 y); + void handleWheelUp(); + void handleWheelDown(); void handleSpaceKey(); void handleAsciiKey(char key); void handleKeyDown(Common::KeyCode keyCode); diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index a8d88a7109..cf21bc094e 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -1025,6 +1025,12 @@ uint32 GameStateMenu::handleMessage(int messageNum, const MessageParam ¶m, E break; } break; + case NM_MOUSE_WHEELUP: + _listBox->scrollUp(); + break; + case NM_MOUSE_WHEELDOWN: + _listBox->scrollDown(); + break; } return 0; } diff --git a/engines/neverhood/messages.h b/engines/neverhood/messages.h index 9816c2ca86..5f1e1b87dd 100644 --- a/engines/neverhood/messages.h +++ b/engines/neverhood/messages.h @@ -65,7 +65,11 @@ enum NeverhoodMessage { NM_KLAYMEN_RELEASE_LEVER = 0x4827, NM_MOVE_TO_BACK = 0x482A, - NM_MOVE_TO_FRONT = 0x482B + NM_MOVE_TO_FRONT = 0x482B, + + // New to ScummVM + NM_MOUSE_WHEELUP = 0xF000, + NM_MOUSE_WHEELDOWN = 0xF001 }; } // End of namespace Neverhood diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index af09624380..82590d6c96 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -178,6 +178,12 @@ void NeverhoodEngine::mainLoop() { case Common::EVENT_RBUTTONUP: _gameModule->handleMouseUp(event.mouse.x, event.mouse.y); break; + case Common::EVENT_WHEELUP: + _gameModule->handleWheelUp(); + break; + case Common::EVENT_WHEELDOWN: + _gameModule->handleWheelDown(); + break; case Common::EVENT_QUIT: _system->quit(); break; |