[Scummvm-cvs-logs] CVS: scummvm/queen command.cpp,1.68.2.3,1.68.2.4 command.h,1.18.2.1,1.18.2.2

Gregory Montoir cyx at users.sourceforge.net
Sat Mar 13 17:02:02 CET 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8855/queen

Modified Files:
      Tag: branch-0-6-0
	command.cpp command.h 
Log Message:
fixed inventory scrolling using keyboard

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.68.2.3
retrieving revision 1.68.2.4
diff -u -d -r1.68.2.3 -r1.68.2.4
--- command.cpp	7 Mar 2004 10:44:43 -0000	1.68.2.3
+++ command.cpp	14 Mar 2004 00:52:53 -0000	1.68.2.4
@@ -502,11 +502,7 @@
 
 	_selPosX += _vm->display()->horizontalScroll();
 
-	if (_state.verb == VERB_SCROLL_UP || _state.verb == VERB_SCROLL_DOWN) {
-		// move through inventory (by four if right mouse button)
-		uint16 scroll = (_mouseKey == Input::MOUSE_RBUTTON) ? 4 : 1;
-		_vm->logic()->inventoryScroll(scroll, _state.verb == VERB_SCROLL_UP);
-	} else if (isVerbAction(_state.verb)) {
+	if (isVerbAction(_state.verb) || isVerbInvScroll(_state.verb)) {
 		grabSelectedVerb();
 	} else if (isVerbInv(_state.verb)) {
 		grabSelectedItem();
@@ -549,7 +545,6 @@
 
 	if (_parse) {
 		_state.verb = VERB_NONE;
-//		_vm->logic()->newRoom(0);
 		_vm->logic()->joeWalk(JWM_EXECUTE);
 		_state.selAction = _state.action;
 		_state.action = VERB_NONE;
@@ -654,18 +649,24 @@
 }
 
 void Command::grabSelectedVerb() {
-	_state.action = _state.verb;
-	_state.subject[0] = 0;
-	_state.subject[1] = 0;
+	if (isVerbInvScroll(_state.verb)) {
+		// move through inventory (by four if right mouse button)
+		uint16 scroll = (_mouseKey == Input::MOUSE_RBUTTON) ? 4 : 1;
+		_vm->logic()->inventoryScroll(scroll, _state.verb == VERB_SCROLL_UP);
+	} else {
+		_state.action = _state.verb;
+		_state.subject[0] = 0;
+		_state.subject[1] = 0;
 
-	if (_vm->logic()->joeWalk() == JWM_MOVE && _state.verb != VERB_NONE) {
-		_vm->logic()->joeWalk(JWM_NORMAL);
+		if (_vm->logic()->joeWalk() == JWM_MOVE && _state.verb != VERB_NONE) {
+			_vm->logic()->joeWalk(JWM_NORMAL);
+		}
+		_state.commandLevel = 1;
+		_state.oldVerb = VERB_NONE;
+		_state.oldNoun = 0;
+		_cmdText.setVerb(_state.verb);
+		_cmdText.display(INK_CMD_NORMAL);
 	}
-	_state.commandLevel = 1;
-	_state.oldVerb = VERB_NONE;
-	_state.oldNoun = 0;
-	_cmdText.setVerb(_state.verb);
-	_cmdText.display(INK_CMD_NORMAL);
 }
 
 bool Command::executeIfCutaway(const char *description) {

Index: command.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.h,v
retrieving revision 1.18.2.1
retrieving revision 1.18.2.2
diff -u -d -r1.18.2.1 -r1.18.2.2
--- command.h	28 Feb 2004 08:51:38 -0000	1.18.2.1
+++ command.h	14 Mar 2004 00:52:53 -0000	1.18.2.2
@@ -138,6 +138,7 @@
 
 	bool isVerbAction(Verb v) const { return (v >= VERB_PANEL_COMMAND_FIRST && v <= VERB_PANEL_COMMAND_LAST) || (v == VERB_WALK_TO); };
 	bool isVerbInv(Verb v) const { return v >= VERB_INV_FIRST && v <= VERB_INV_LAST; }
+	bool isVerbInvScroll(Verb v) const { return v == VERB_SCROLL_UP || v == VERB_SCROLL_DOWN; }
  
 	CmdListData *_cmdList;
 	uint16 _numCmdList;





More information about the Scummvm-git-logs mailing list