aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-25 07:27:17 +0000
committerEugene Sandulenko2010-08-25 07:27:17 +0000
commit540cff87dca6bd80bc90f3b7175cd9fe74b780d4 (patch)
treee77db40054292b767cf4c1d45e99dc290d88aeb9 /engines
parent4395e75aef8572ef3fa06fd44cd8129dea2d91c8 (diff)
downloadscummvm-rg350-540cff87dca6bd80bc90f3b7175cd9fe74b780d4.tar.gz
scummvm-rg350-540cff87dca6bd80bc90f3b7175cd9fe74b780d4.tar.bz2
scummvm-rg350-540cff87dca6bd80bc90f3b7175cd9fe74b780d4.zip
SCUMM: Implement keyboard-driven inventory scrolling in v2
Bug #2828383: "ZAK V2: no inventory keyboard shortcuts". svn-id: r52366
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/verbs.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 95fba8ee7e..5f8a6d9f52 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -651,6 +651,50 @@ void ScummEngine_v2::checkExecVerbs() {
}
}
+ // Simulate inventory picking and scrolling keys
+ int object = -1;
+
+ switch (_mouseAndKeyboardStat) {
+ case 'u': // arrow up
+ if (_inventoryOffset >= 2) {
+ _inventoryOffset -= 2;
+ redrawV2Inventory();
+ }
+ return;
+ case 'j': // arrow down
+ if (_inventoryOffset + 4 < getInventoryCount(_scummVars[VAR_EGO])) {
+ _inventoryOffset += 2;
+ redrawV2Inventory();
+ }
+ return;
+ case 'i': // object
+ object = 0;
+ break;
+ case 'o':
+ object = 1;
+ break;
+ case 'k':
+ object = 2;
+ break;
+ case 'l':
+ object = 3;
+ break;
+ }
+
+ if (object != -1) {
+ object = findInventory(_scummVars[VAR_EGO], object + 1 + _inventoryOffset);
+
+ if (object > 0) {
+ if (_game.version == 0) {
+ _activeInventory = object;
+
+ } else {
+ runInputScript(kInventoryClickArea, object, 0);
+ }
+ }
+ return;
+ }
+
// Generic keyboard input
runInputScript(kKeyClickArea, _mouseAndKeyboardStat, 1);
} else if (_mouseAndKeyboardStat & MBS_MOUSE_MASK) {