From 57dcf42b5c296c071de68842c4153d654fe43b9f Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 28 Dec 2022 17:33:01 +0300 Subject: [PATCH] Fix custom disposition button --- src/game_dialog.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/game_dialog.cc b/src/game_dialog.cc index 258c007..c0924e9 100644 --- a/src/game_dialog.cc +++ b/src/game_dialog.cc @@ -3758,11 +3758,16 @@ void partyMemberControlWindowHandleEvents() return; } } else if (keyCode == -2) { - if (_mouse_click_in(441, 451, 540, 470)) { - aiSetDisposition(gGameDialogSpeaker, 0); - _dialogue_state = 13; - _dialogue_switch_mode = 11; - done = true; + // CE: Minor improvement - handle on mouse up (just like other + // buttons). Also fixed active button area (in original code + // it's slightly smaller than the button itself). + if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_UP) != 0) { + if (mouseHitTestInWindow(gGameDialogWindow, 438, 156, 438 + 109, 156 + 28)) { + aiSetDisposition(gGameDialogSpeaker, 0); + _dialogue_state = 13; + _dialogue_switch_mode = 11; + done = true; + } } } }