[Scummvm-cvs-logs] SF.net SVN: scummvm:[52366] scummvm/trunk/engines/scumm/verbs.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Aug 25 09:27:18 CEST 2010


Revision: 52366
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52366&view=rev
Author:   sev
Date:     2010-08-25 07:27:17 +0000 (Wed, 25 Aug 2010)

Log Message:
-----------
SCUMM: Implement keyboard-driven inventory scrolling in v2

Bug #2828383: "ZAK V2: no inventory keyboard shortcuts".

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/verbs.cpp

Modified: scummvm/trunk/engines/scumm/verbs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/verbs.cpp	2010-08-25 06:55:11 UTC (rev 52365)
+++ scummvm/trunk/engines/scumm/verbs.cpp	2010-08-25 07:27:17 UTC (rev 52366)
@@ -651,6 +651,50 @@
 			}
 		}
 
+		// 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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list