[Scummvm-cvs-logs] CVS: scummvm/queen command.cpp,1.71,1.72 command.h,1.19,1.20
Gregory Montoir
cyx at users.sourceforge.net
Sat Mar 13 17:08:04 CET 2004
Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8955/queen
Modified Files:
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.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- command.cpp 7 Mar 2004 10:46:01 -0000 1.71
+++ command.cpp 14 Mar 2004 00:53:24 -0000 1.72
@@ -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.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- command.h 28 Feb 2004 08:52:53 -0000 1.19
+++ command.h 14 Mar 2004 00:53:24 -0000 1.20
@@ -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