aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-07-19 02:50:17 +0200
committerThierry Crozat2018-01-23 00:00:11 +0000
commit83523ebbdc837290e48f9b22f23ac2e83e1510a4 (patch)
tree2cfc0cb98ecf5eab2285894c6e7994760aa6c917 /engines
parentd70ded12f67b45a9693dbd04f13f6240b344cd9b (diff)
downloadscummvm-rg350-83523ebbdc837290e48f9b22f23ac2e83e1510a4.tar.gz
scummvm-rg350-83523ebbdc837290e48f9b22f23ac2e83e1510a4.tar.bz2
scummvm-rg350-83523ebbdc837290e48f9b22f23ac2e83e1510a4.zip
SUPERNOVA: Corrects left mouse click behavior
This still needs work especially concerning actions that need two objects like ACTION_USE or ACTION_GIVE.
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/state.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index b1e418268c..b90e816e89 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -278,24 +278,31 @@ void GameManager::processInput(Common::EventType eventType, int x, int y) {
if (_mouseClickType == Common::EVENT_LBUTTONUP) {
_vm->removeMessage();
- if (Object::isNullObject(_currentInputObject))
- return;
- if (_mouseField >= 256 && _mouseField < 512) {
+ if (((_mouseField >= 0) && (_mouseField < 256)) ||
+ ((_mouseField >= 512) && (_mouseField < 768))) {
+ if (_inputVerb == ACTION_GIVE || _inputVerb == ACTION_USE) {
+ // TODO: There are cases where here is no second object needed
+ // for example, putting on the space suit
+ if (Object::isNullObject(_inputObject[0]))
+ _inputObject[0] = _currentInputObject;
+ else
+ _inputObject[1] = _currentInputObject;
+ } else {
+ _inputObject[0] = _currentInputObject;
+ if (!Object::isNullObject(_currentInputObject))
+ _processInput = true;
+ }
+ } else if (_mouseField >= 256 && _mouseField < 512) {
resetInputState();
_inputVerb = static_cast<Action>(_mouseField - 256);
drawStatus();
+ } else if (_mouseField == 768) {
+ if (_inventoryScroll >= 0)
+ --_inventoryScroll;
+ } else if (_mouseField == 769) {
+ ++_inventoryScroll;
}
- if (_inputVerb == ACTION_GIVE || _inputVerb == ACTION_USE) {
- if (Object::isNullObject(_inputObject[0]))
- _inputObject[0] = _currentInputObject;
- else
- _inputObject[1] = _currentInputObject;
- } else {
- _inputObject[0] = _currentInputObject;
- _processInput = true;
- }
-
} else if (_mouseClickType == Common::EVENT_RBUTTONUP) {
_vm->removeMessage();
if (Object::isNullObject(_currentInputObject))