aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLittleboy2011-05-04 10:10:46 -0400
committerLittleboy2011-05-10 19:18:26 -0400
commit3088acf69a41dc0e942faad1b624fe097c690a3e (patch)
tree989a3ae9eae02796d9ba3ec1962bd0e55b15fc9c
parent1516ba73671d59ab5d6e26602dbb1e5055cbb05c (diff)
downloadscummvm-rg350-3088acf69a41dc0e942faad1b624fe097c690a3e.tar.gz
scummvm-rg350-3088acf69a41dc0e942faad1b624fe097c690a3e.tar.bz2
scummvm-rg350-3088acf69a41dc0e942faad1b624fe097c690a3e.zip
LASTEXPRESS: Add button pressed state for inventory handling
-rw-r--r--engines/lastexpress/game/inventory.cpp6
-rw-r--r--engines/lastexpress/game/state.h6
-rw-r--r--engines/lastexpress/lastexpress.cpp3
3 files changed, 13 insertions, 2 deletions
diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp
index 25db782c62..5df745d641 100644
--- a/engines/lastexpress/game/inventory.cpp
+++ b/engines/lastexpress/game/inventory.cpp
@@ -186,7 +186,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
error("[Inventory::handleMouseEvent] Click on highlighted item not implemented");
}
} else {
- error("[Inventory::handleMouseEvent] Default handling of open menu not implemented");
+ warning("[Inventory::handleMouseEvent] Default handling of open menu not implemented");
}
} else {
if (_portraitHighlighted) {
@@ -251,6 +251,8 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
askForRedraw();
}
+ return;
+
// Stop processing if we are not looking at an item already
if (!getState()->sceneUseBackup) {
_isOpened = false;
@@ -287,7 +289,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
if (!_portraitHighlighted && !_isOpened) {
drawItem((CursorStyle)getProgress().portrait, 0, 0);
_portraitHighlighted = true;
- } else if (!_isOpened || (ev.type == Common::EVENT_LBUTTONDOWN || ev.type == Common::EVENT_LBUTTONUP)) {
+ } else if (!_isOpened || getFlags()->mouseLeftPressed) {
// Do nothing
} else if (_isOpened) {
close();
diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h
index 4196bfe06a..663550acc2 100644
--- a/engines/lastexpress/game/state.h
+++ b/engines/lastexpress/game/state.h
@@ -566,6 +566,9 @@ public:
bool mouseLeftClick;
bool mouseRightClick;
+ bool mouseLeftPressed;
+ bool mouseRightPressed;
+
bool flag_entities_0;
bool flag_entities_1;
@@ -587,6 +590,9 @@ public:
mouseRightClick = false;
mouseLeftClick = false;
+ mouseLeftPressed = false;
+ mouseRightPressed = false;
+
flag_entities_0 = false;
flag_entities_1 = false;
diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp
index 7c08fef627..535f5e86b7 100644
--- a/engines/lastexpress/lastexpress.cpp
+++ b/engines/lastexpress/lastexpress.cpp
@@ -215,6 +215,7 @@ bool LastExpressEngine::handleEvents() {
case Common::EVENT_LBUTTONUP:
case Common::EVENT_LBUTTONDOWN:
getGameLogic()->getGameState()->getGameFlags()->mouseLeftClick = true;
+ getGameLogic()->getGameState()->getGameFlags()->mouseLeftPressed = (ev.type == Common::EVENT_LBUTTONDOWN) ? true : false;
// Adjust frameInterval flag
if (_frameCounter < _lastFrameCount + 30)
@@ -228,6 +229,8 @@ bool LastExpressEngine::handleEvents() {
case Common::EVENT_RBUTTONUP:
case Common::EVENT_RBUTTONDOWN:
getGameLogic()->getGameState()->getGameFlags()->mouseRightClick = true;
+ getGameLogic()->getGameState()->getGameFlags()->mouseRightPressed = (ev.type == Common::EVENT_RBUTTONDOWN) ? true : false;
+
if (_eventMouse && _eventMouse->isValid())
(*_eventMouse)(ev);
break;