mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
AGI: Message box mouse support
This commit is contained in:
parent
d23871fdd8
commit
a9bb8c3a50
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user