aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/parallaction/input.cpp')
-rw-r--r--engines/parallaction/input.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index 243eaec94f..518c165155 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -171,9 +171,7 @@ void Input::updateGameInput() {
} else {
_inputData._mousePos = _mousePos;
_inputData._event = kEvNone;
- if (!translateGameInput()) {
- translateInventoryInput();
- }
+ translateGameInput();
}
}
@@ -192,6 +190,11 @@ InputData* Input::updateInput() {
case kInputModeGame:
updateGameInput();
break;
+
+ case kInputModeInventory:
+ readInput();
+ updateInventoryInput();
+ break;
}
return &_inputData;
@@ -234,7 +237,7 @@ void Input::walkTo(const Common::Point &dest) {
bool Input::translateGameInput() {
- if ((_engineFlags & kEnginePauseJobs) || (_engineFlags & kEngineInventory)) {
+ if (_engineFlags & kEnginePauseJobs) {
return false;
}
@@ -310,6 +313,8 @@ void Input::enterInventoryMode() {
_vm->openInventory();
_transCurrentHoverItem = -1;
+
+ _inputMode = kInputModeInventory;
}
void Input::exitInventoryMode() {
@@ -339,22 +344,17 @@ void Input::exitInventoryMode() {
_vm->setInventoryCursor(item);
}
_vm->resumeJobs();
-}
-
-bool Input::translateInventoryInput() {
- if ((_engineFlags & kEngineInventory) == 0) {
- return false;
- }
-
- // in inventory
- int16 _si = _vm->getHoverInventoryItem(_mousePos.x, _mousePos.y);
+ _inputMode = kInputModeGame;
+}
+bool Input::updateInventoryInput() {
if (_mouseButtons == kMouseRightUp) {
exitInventoryMode();
return true;
}
+ int16 _si = _vm->getHoverInventoryItem(_mousePos.x, _mousePos.y);
if (_si != _transCurrentHoverItem) {
_transCurrentHoverItem = _si;
_vm->highlightInventoryItem(_si); // enable