diff options
author | Adrian Frühwirth | 2018-02-03 21:46:45 +0100 |
---|---|---|
committer | Adrian Frühwirth | 2018-02-03 22:08:33 +0100 |
commit | 7e0cac25de91ff2d1f14cd852e0a2b8dba64d173 (patch) | |
tree | 5029c7f7eae059ec44ae30be96ccf8cb2c73a8ac /engines/tucker/tucker.cpp | |
parent | 56f90028b50bd17e6e681dd9bd753c4dadc164f1 (diff) | |
download | scummvm-rg350-7e0cac25de91ff2d1f14cd852e0a2b8dba64d173.tar.gz scummvm-rg350-7e0cac25de91ff2d1f14cd852e0a2b8dba64d173.tar.bz2 scummvm-rg350-7e0cac25de91ff2d1f14cd852e0a2b8dba64d173.zip |
TUCKER: Add inventory and save slot scrolling via mouse wheel
Fixes Trac#10424.
Diffstat (limited to 'engines/tucker/tucker.cpp')
-rw-r--r-- | engines/tucker/tucker.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index d9e14b32fb..d233826901 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -682,6 +682,12 @@ void TuckerEngine::parseEvents() { case Common::EVENT_RBUTTONUP: updateCursorPos(ev.mouse.x, ev.mouse.y); break; + case Common::EVENT_WHEELUP: + _mouseButtonsMask |= 4; + break; + case Common::EVENT_WHEELDOWN: + _mouseButtonsMask |= 8; + break; default: break; } @@ -782,6 +788,8 @@ void TuckerEngine::updateMouseState() { _gameHintsStringNum = 0; } _rightMouseButtonPressed = (_mouseButtonsMask & 2) != 0; + _mouseWheelUp = _mouseButtonsMask & 4; + _mouseWheelDown = _mouseButtonsMask & 8; _mouseButtonsMask = 0; if (_prevMousePosX == _mousePosX && _prevMousePosY == _mousePosY) { ++_mouseIdleCounter; @@ -1082,6 +1090,12 @@ void TuckerEngine::updateCursor() { if (!_leftMouseButtonPressed) { _mouseClick = 0; } + if (_mousePosY >= 150) { + if (_mouseWheelUp) + moveDownInventoryObjects(); + else if (_mouseWheelDown) + moveUpInventoryObjects(); + } if (_leftMouseButtonPressed && _mouseClick == 0) { _fadedPanel = 0; _mouseClick = 1; @@ -1331,6 +1345,17 @@ void TuckerEngine::saveOrLoad() { } else { drawSpeechText(_scrollOffset + 120, 170, _infoBarBuf, 21, 102); } + if (_mousePosY > 140) { + if (_mouseWheelUp && _currentSaveLoadGameState < 99) { + ++_currentSaveLoadGameState; + _forceRedrawPanelItems = true; + return; + } else if (_mouseWheelDown && _currentSaveLoadGameState > 1) { + --_currentSaveLoadGameState; + _forceRedrawPanelItems = true; + return; + } + } if (_leftMouseButtonPressed && _mouseClick == 0) { _mouseClick = 1; if (_mousePosX > 228 && _mousePosX < 240 && _mousePosY > 154 && _mousePosY < 170) { |