aboutsummaryrefslogtreecommitdiff
path: root/queen/command.cpp
diff options
context:
space:
mode:
authorGregory Montoir2003-12-14 21:39:52 +0000
committerGregory Montoir2003-12-14 21:39:52 +0000
commit8b2f43f2bd70e3808a6ef0caddef6709dafb6494 (patch)
tree877339b742447d0790b0ee964f5e0634a4423bc2 /queen/command.cpp
parent5e000ec43f771155f9ecc605c60d39511661d908 (diff)
downloadscummvm-rg350-8b2f43f2bd70e3808a6ef0caddef6709dafb6494.tar.gz
scummvm-rg350-8b2f43f2bd70e3808a6ef0caddef6709dafb6494.tar.bz2
scummvm-rg350-8b2f43f2bd70e3808a6ef0caddef6709dafb6494.zip
re-enable keyboard commands
svn-id: r11641
Diffstat (limited to 'queen/command.cpp')
-rw-r--r--queen/command.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/queen/command.cpp b/queen/command.cpp
index e5e0369bf6..bdfd39bbbe 100644
--- a/queen/command.cpp
+++ b/queen/command.cpp
@@ -249,23 +249,23 @@ void Command::updatePlayer() {
_vm->input()->clearKeyVerb();
_vm->logic()->useJournal();
}
-// else if (_vm->input()->keyVerb() != VERB_SKIP_TEXT) {
-// _state.verb = _vm->input()->keyVerb();
-// if (isVerbInv(_state.verb)) {
-// _state.noun = _state.selNoun = 0;
-// // Clear old noun and old verb in case we're pointing at an
-// // object (noun) or item (verb) and we want to use an item
-// // on it. This was the command will be redisplayed with the
-// // object/item that the cursor is currently on.
-// _state.oldNoun = 0;
-// _state.oldVerb = VERB_NONE;
-// grabSelectedItem();
-// }
-// else {
-// grabSelectedVerb();
-// }
-// _vm->input()->clearKeyVerb();
-// }
+ else if (_vm->input()->keyVerb() != VERB_SKIP_TEXT) {
+ _state.verb = _vm->input()->keyVerb();
+ if (isVerbInv(_state.verb)) {
+ _state.noun = _state.selNoun = 0;
+ // Clear old noun and old verb in case we're pointing at an
+ // object (noun) or item (verb) and we want to use an item
+ // on it. This was the command will be redisplayed with the
+ // object/item that the cursor is currently on.
+ _state.oldNoun = 0;
+ _state.oldVerb = VERB_NONE;
+ grabSelectedItem();
+ }
+ else {
+ grabSelectedVerb();
+ }
+ _vm->input()->clearKeyVerb();
+ }
}
_mouseKey = _vm->input()->mouseButton();
@@ -612,26 +612,26 @@ void Command::grabSelectedItem() {
// If we've selected via keyboard, and there is no VERB then do
// the ITEMs default, otherwise keep constructing!
- if (_mouseKey == Input::MOUSE_LBUTTON) {
-// || (_vm->input()->keyVerb() != VERB_NONE && _state.verb != VERB_NONE)) {
+ if (_mouseKey == Input::MOUSE_LBUTTON ||
+ (_vm->input()->keyVerb() != VERB_NONE && _state.verb != VERB_NONE)) {
if (_state.action == VERB_NONE) {
-// if (_vm->input()->keyVerb() != VERB_NONE) {
-// // We've selected via the keyboard, no command is being
-// // constructed, so we shall find the item's default
-// _state.verb = findDefault(item, true);
-// if (_state.verb == VERB_NONE) {
-// // set to Look At
-// _state.verb = VERB_LOOK_AT;
-// _cmdText.setVerb(VERB_LOOK_AT);
-// }
-// _state.action = _state.verb;
-// }
-// else {
+ if (_vm->input()->keyVerb() != VERB_NONE) {
+ // We've selected via the keyboard, no command is being
+ // constructed, so we shall find the item's default
+ _state.verb = State::findDefaultVerb(id->state);
+ if (_state.verb == VERB_NONE) {
+ // set to Look At
+ _state.verb = VERB_LOOK_AT;
+ _cmdText.setVerb(VERB_LOOK_AT);
+ }
+ _state.action = _state.verb;
+ }
+ else {
// Action>0 ONLY if command has been constructed
// Left Mouse Button pressed just do Look At
_state.action = VERB_LOOK_AT;
_cmdText.setVerb(VERB_LOOK_AT);
-// }
+ }
}
_state.verb = VERB_NONE;
}