diff options
-rw-r--r-- | queen/command.cpp | 33 | ||||
-rw-r--r-- | queen/command.h | 1 |
2 files changed, 18 insertions, 16 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index 45366f69d3..27b9e2773e 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -502,11 +502,7 @@ void Command::grabCurrentSelection() { _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 @@ void Command::grabSelectedObject(int16 objNum, uint16 objState, uint16 objName) 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::grabSelectedNoun() { } 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) { diff --git a/queen/command.h b/queen/command.h index 46cfbb3f37..1b0cdc4cd9 100644 --- a/queen/command.h +++ b/queen/command.h @@ -138,6 +138,7 @@ private: 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; |