diff options
author | Paul Gilbert | 2014-04-17 22:11:25 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-17 22:11:25 -0400 |
commit | 8c9b65c34ae264686efb3f4bb276506eb6d727c3 (patch) | |
tree | 0d8a0fd3a1a68d9d71ce2ec250f59aba3ba903d9 /engines | |
parent | 40f2b01dfb20ac68986d44765dd7b045b6f5861b (diff) | |
download | scummvm-rg350-8c9b65c34ae264686efb3f4bb276506eb6d727c3.tar.gz scummvm-rg350-8c9b65c34ae264686efb3f4bb276506eb6d727c3.tar.bz2 scummvm-rg350-8c9b65c34ae264686efb3f4bb276506eb6d727c3.zip |
MADS: Fixes for inventory scroller
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/user_interface.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 4348d833c9..594d549f87 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -354,12 +354,12 @@ void UserInterface::updateInventoryScroller() { uint32 currentMilli = g_system->getMillis(); uint32 timeInc = _scrollbarQuickly ? 100 : 380; - if (_vm->_events->_mouseClicked || (_vm->_events->_mouseStatusCopy && (_scrollbarMilliTime + timeInc) <= currentMilli)) { + if (_vm->_events->_mouseStatus && (_scrollbarMilliTime + timeInc) <= currentMilli) { _scrollbarQuickly = _vm->_events->_vD2 < 1; _scrollbarMilliTime = currentMilli; switch (_scrollbarStrokeType) { - case 1: + case SCROLLBAR_UP: // Scroll up if (_inventoryTopIndex > 0 && inventoryList.size() > 0) { --_inventoryTopIndex; @@ -367,7 +367,7 @@ void UserInterface::updateInventoryScroller() { } break; - case 2: + case SCROLLBAR_DOWN: // Scroll down if (_inventoryTopIndex < ((int)inventoryList.size() - 1) && inventoryList.size() > 1) { ++_inventoryTopIndex; @@ -375,7 +375,7 @@ void UserInterface::updateInventoryScroller() { } break; - case 3: { + case SCROLLBAR_ELEVATOR: { // Inventory slider int newIndex = CLIP((int)_vm->_events->currentPos().y - 170, 0, 17) * inventoryList.size() / 10; @@ -447,11 +447,11 @@ void UserInterface::writeVocab(ScrCategory category, int id) { _vm->_font->setColorMode(SELMODE_HIGHLIGHTED); } else { _vm->_font->setColorMode(id == _selectedInvIndex ? SELMODE_SELECTED : SELMODE_UNSELECTED); - vocabStr = scene.getVocab(vocabId); - vocabStr.setChar(toupper(vocabStr[0]), 0); - font->writeString(this, vocabStr, Common::Point(bounds.left, bounds.top)); - break; } + + vocabStr = scene.getVocab(vocabId); + vocabStr.setChar(toupper(vocabStr[0]), 0); + font->writeString(this, vocabStr, Common::Point(bounds.left, bounds.top)); break; case CAT_TALK_ENTRY: @@ -583,7 +583,7 @@ bool UserInterface::getBounds(ScrCategory category, int v, Common::Rect &bounds) break; case CAT_INV_LIST: - if (v < _inventoryTopIndex || v > (_inventoryTopIndex + 5)) + if (v < _inventoryTopIndex || v >= (_inventoryTopIndex + 5)) return false; heightMultiplier = v - _inventoryTopIndex; @@ -625,22 +625,22 @@ bool UserInterface::getBounds(ScrCategory category, int v, Common::Rect &bounds) if (category == CAT_INV_SCROLLER) { switch (v) { - case 1: + case SCROLLBAR_UP: // Arrow up bounds.top = 4; bounds.setHeight(7); break; - case 2: + case SCROLLBAR_DOWN: // Arrow down bounds.top = 35; bounds.setHeight(7); break; - case 3: + case SCROLLBAR_ELEVATOR: // Scroller bounds.top = 12; bounds.setHeight(22); break; - case 4: + case SCROLLBAR_THUMB: // Thumb bounds.top = _scrollbarElevator + 14; bounds.setHeight(1); |