aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-03 08:27:44 +0100
committerMartin Kiewitz2016-02-03 08:27:44 +0100
commita9bb8c3a50c49b27c1235599ca169390aad959e7 (patch)
treec132204185aafcc2c6c33c26478300b9a9abb1eb /engines/agi
parentd23871fdd83299dfe5b559f8b6b828c9315a84b1 (diff)
downloadscummvm-rg350-a9bb8c3a50c49b27c1235599ca169390aad959e7.tar.gz
scummvm-rg350-a9bb8c3a50c49b27c1235599ca169390aad959e7.tar.bz2
scummvm-rg350-a9bb8c3a50c49b27c1235599ca169390aad959e7.zip
AGI: Message box mouse support
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/keyboard.cpp3
-rw-r--r--engines/agi/text.cpp18
2 files changed, 21 insertions, 0 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 169c294e4d..5ef6dd256f 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -340,13 +340,16 @@ bool AgiEngine::handleMouseClicks(uint16 &key) {
case CYCLE_INNERLOOP_INVENTORY:
// TODO: forward
break;
+
case CYCLE_INNERLOOP_MENU_VIA_KEYBOARD:
_menu->mouseEvent(key);
key = 0; // eat event
break;
+
case CYCLE_INNERLOOP_SYSTEMUI_SELECTSAVEDGAMESLOT:
// TODO: forward
break;
+
default:
break;
}
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 135d05e0df..691c0aedfb 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -392,6 +392,24 @@ void TextMgr::messageBox_KeyPress(uint16 newKey) {
_messageBoxCancelled = true;
_vm->cycleInnerLoopInactive(); // exit messagebox-loop
break;
+ case AGI_MOUSE_BUTTON_LEFT: {
+ // Find out, where current mouse cursor actually is
+ int16 mouseY = _vm->_mouse.pos.y;
+ int16 mouseX = _vm->_mouse.pos.x;
+
+ _vm->adjustPosToGameScreen(mouseX, mouseY);
+
+ // Check, if mouse cursor is within message box
+ // If it is, take the click as ENTER.
+ // That's what AGI on Amiga + Apple IIgs did.
+ // On Atari ST at least via emulator it seems that the mouse cursor froze when messageboxes were diplayed.
+ if ((mouseX >= _messageState.backgroundPos_x) && (mouseX <= (_messageState.backgroundPos_x + _messageState.backgroundSize_Width))) {
+ if ((mouseY >= _messageState.backgroundPos_y - _messageState.backgroundSize_Height) && (mouseY <= (_messageState.backgroundPos_y))) {
+ _vm->cycleInnerLoopInactive(); // exit messagebox-loop
+ }
+ }
+ break;
+ }
default:
break;
}