handle mouse wheel in Journal screen

svn-id: r11758
This commit is contained in:
Gregory Montoir 2003-12-19 09:21:02 +00:00
parent a3310a5de9
commit dae474e86d
2 changed files with 22 additions and 0 deletions

View File

@ -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);

View File

@ -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);