Permalink
Browse files

SUPERNOVA: Corrects left mouse click behavior

This still needs work especially concerning actions that need two
objects like ACTION_USE or ACTION_GIVE.
  • Loading branch information...
Joefish committed Jul 19, 2017
1 parent ec43253 commit 1e43a9fe15b5507ed1091f146b37fabaefb1b33e
Showing with 20 additions and 13 deletions.
  1. +20 −13 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))

0 comments on commit 1e43a9f

Please sign in to comment.