Skip to content

Commit

Permalink
SUPERNOVA: Corrects left mouse click behavior
Browse files Browse the repository at this point in the history
This still needs work especially concerning actions that need two
objects like ACTION_USE or ACTION_GIVE.
  • Loading branch information
Joseph-Eugene Winzer committed Jul 19, 2017
1 parent ec43253 commit 1e43a9f
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions engines/supernova/state.cpp
Expand Up @@ -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))
Expand Down

0 comments on commit 1e43a9f

Please sign in to comment.