diff options
author | Gregory Montoir | 2003-12-19 09:21:02 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-12-19 09:21:02 +0000 |
commit | dae474e86da67330fa0d0fd7a4637d6bedff43e6 (patch) | |
tree | 7e697735c9884757873f92a28bc356cea99fd075 /queen | |
parent | a3310a5de932095809e21b63ee593efe213a3080 (diff) | |
download | scummvm-rg350-dae474e86da67330fa0d0fd7a4637d6bedff43e6.tar.gz scummvm-rg350-dae474e86da67330fa0d0fd7a4637d6bedff43e6.tar.bz2 scummvm-rg350-dae474e86da67330fa0d0fd7a4637d6bedff43e6.zip |
handle mouse wheel in Journal screen
svn-id: r11758
Diffstat (limited to 'queen')
-rw-r--r-- | queen/journal.cpp | 21 | ||||
-rw-r--r-- | queen/journal.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/queen/journal.cpp b/queen/journal.cpp index 528d77789f..f2e36ff550 100644 --- a/queen/journal.cpp +++ b/queen/journal.cpp @@ -70,6 +70,12 @@ void Journal::use() { case OSystem::EVENT_LBUTTONDOWN: handleMouseDown(event.mouse.x, event.mouse.y); break; + case OSystem::EVENT_WHEELUP: + handleMouseWheel(-1); + break; + case OSystem::EVENT_WHEELDOWN: + handleMouseWheel(1); + break; case OSystem::EVENT_QUIT: system->quit(); break; @@ -356,6 +362,21 @@ void Journal::handleYesNoMode(int16 zoneNum) { } +void Journal::handleMouseWheel(int inc) { + + if (_mode == M_NORMAL) { + int curSave = _currentSavePage * SAVE_PER_PAGE + _currentSaveSlot + inc; + if (curSave >= 0 && curSave < SAVE_PER_PAGE * 10) { + _currentSavePage = curSave / SAVE_PER_PAGE; + _currentSaveSlot = curSave % SAVE_PER_PAGE; + drawSaveDescriptions(); + drawSaveSlot(); + update(); + } + } +} + + void Journal::handleMouseDown(int x, int y) { int16 zone = _vm->logic()->zoneIn(ZONE_ROOM, x, y); diff --git a/queen/journal.h b/queen/journal.h index ee20772c1d..4d8f2437ff 100644 --- a/queen/journal.h +++ b/queen/journal.h @@ -132,6 +132,7 @@ private: void handleInfoBoxMode(int16 zoneNum); void handleYesNoMode(int16 zoneNum); + void handleMouseWheel(int inc); void handleMouseDown(int x, int y); void handleKeyDown(uint16 ascii, int keycode); |