mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 20:51:14 +00:00
MADS: Fix right mouse button handling
This commit is contained in:
parent
2a105149fe
commit
06aeba275a
@ -366,7 +366,7 @@ void MADSAction::checkActionAtMousePos() {
|
||||
scene._lookFlag = true;
|
||||
}
|
||||
|
||||
if (_vm->_events->_anyStroke && _vm->_events->_mouseButtons) {
|
||||
if (_vm->_events->_rightMousePressed && _vm->_events->_mouseButtons) {
|
||||
switch (userInterface._category) {
|
||||
case CAT_COMMAND:
|
||||
case CAT_INV_VOCAB:
|
||||
@ -507,7 +507,7 @@ void MADSAction::leftClick() {
|
||||
}
|
||||
}
|
||||
|
||||
if (abortFlag || (_vm->_events->_anyStroke && (userInterface._category == CAT_COMMAND ||
|
||||
if (abortFlag || (_vm->_events->_rightMousePressed && (userInterface._category == CAT_COMMAND ||
|
||||
userInterface._category == CAT_INV_VOCAB)))
|
||||
return;
|
||||
|
||||
|
@ -46,7 +46,7 @@ EventsManager::EventsManager(MADSEngine *vm) {
|
||||
_vD4 = 0;
|
||||
_mouseMoved = false;
|
||||
_vD8 = 0;
|
||||
_anyStroke = false;
|
||||
_rightMousePressed = false;
|
||||
}
|
||||
|
||||
EventsManager::~EventsManager() {
|
||||
@ -129,21 +129,20 @@ void EventsManager::pollEvents() {
|
||||
case Common::EVENT_RBUTTONDOWN:
|
||||
_mouseClicked = true;
|
||||
_mouseButtons = 1;
|
||||
_rightMousePressed = event.type == Common::EVENT_RBUTTONDOWN;
|
||||
_mouseMoved = true;
|
||||
//_anyStroke = true;
|
||||
return;
|
||||
case Common::EVENT_LBUTTONUP:
|
||||
case Common::EVENT_RBUTTONUP:
|
||||
_mouseClicked = false;
|
||||
_mouseReleased = true;
|
||||
_mouseMoved = true;
|
||||
//_anyStroke = true;
|
||||
_rightMousePressed = false;
|
||||
return;
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
_mousePos = event.mouse;
|
||||
_currentPos = event.mouse;
|
||||
_mouseMoved = true;
|
||||
//_anyStroke = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
bool _mouseClicked;
|
||||
bool _mouseReleased;
|
||||
byte _mouseButtons;
|
||||
bool _anyStroke;
|
||||
bool _rightMousePressed;
|
||||
bool _keyPressed;
|
||||
int _vCC;
|
||||
int _vD2;
|
||||
|
@ -523,7 +523,7 @@ void Scene::updateCursor() {
|
||||
Player &player = _vm->_game->_player;
|
||||
|
||||
CursorType cursorId = CURSOR_ARROW;
|
||||
if (_action._interAwaiting == 1 && !_vm->_events->_anyStroke &&
|
||||
if (_action._interAwaiting == 1 && !_vm->_events->_rightMousePressed &&
|
||||
_vm->_game->_screenObjects._category == CAT_HOTSPOT) {
|
||||
int idx = _vm->_game->_screenObjects._selectedObject -
|
||||
_userInterface._categoryIndexes[CAT_HOTSPOT - 1];
|
||||
|
@ -286,7 +286,7 @@ void ScreenObjects::check(bool scanFlag) {
|
||||
UserInterface &userInterface = scene._userInterface;
|
||||
|
||||
if (!_vm->_events->_mouseButtons || _inputMode != kInputBuildingSentences)
|
||||
_vm->_events->_anyStroke = false;
|
||||
_vm->_events->_rightMousePressed = false;
|
||||
|
||||
if ((_vm->_events->_mouseMoved || _vm->_game->_scene._userInterface._scrollerY
|
||||
|| _v8332A || _v8333C) && scanFlag) {
|
||||
@ -473,13 +473,13 @@ void ScreenObjects::elementHighlighted() {
|
||||
indexEnd = 9;
|
||||
varA = 5;
|
||||
topIndex = 0;
|
||||
idxP = !_vm->_events->_anyStroke ? &userInterface._highlightedCommandIndex :
|
||||
idxP = !_vm->_events->_rightMousePressed ? &userInterface._highlightedCommandIndex :
|
||||
&userInterface._selectedActionIndex;
|
||||
|
||||
if (_vm->_events->_anyStroke && userInterface._selectedItemVocabIdx >= 0)
|
||||
if (_vm->_events->_rightMousePressed && userInterface._selectedItemVocabIdx >= 0)
|
||||
userInterface.updateSelection(CAT_INV_VOCAB, -1, &userInterface._selectedItemVocabIdx);
|
||||
|
||||
var4 = _released && !_vm->_events->_anyStroke ? 1 : 0;
|
||||
var4 = _released && !_vm->_events->_rightMousePressed ? 1 : 0;
|
||||
break;
|
||||
|
||||
case CAT_INV_LIST:
|
||||
@ -505,12 +505,12 @@ void ScreenObjects::elementHighlighted() {
|
||||
|
||||
varA = 0;
|
||||
topIndex = 0;
|
||||
idxP = _vm->_events->_anyStroke ? &userInterface._selectedItemVocabIdx : &userInterface._highlightedActionIndex;
|
||||
idxP = _vm->_events->_rightMousePressed ? &userInterface._selectedItemVocabIdx : &userInterface._highlightedActionIndex;
|
||||
|
||||
if (_vm->_events->_anyStroke && userInterface._selectedActionIndex >= 0)
|
||||
if (_vm->_events->_rightMousePressed && userInterface._selectedActionIndex >= 0)
|
||||
userInterface.updateSelection(CAT_COMMAND, -1, &userInterface._selectedActionIndex);
|
||||
|
||||
var4 = _released && !_vm->_events->_anyStroke ? 1 : 0;
|
||||
var4 = _released && !_vm->_events->_rightMousePressed ? 1 : 0;
|
||||
break;
|
||||
|
||||
case CAT_INV_ANIM:
|
||||
@ -605,7 +605,7 @@ void ScreenObjects::elementHighlighted() {
|
||||
newIndex = -1;
|
||||
}
|
||||
|
||||
if (_released && !_vm->_events->_anyStroke &&
|
||||
if (_released && !_vm->_events->_rightMousePressed &&
|
||||
(_vm->_events->_mouseReleased || !_vm->_easyMouse))
|
||||
newIndex = -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user