From ae02ac47936fe94edcc7929e1bcf68e50ab2f6fa Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 8 Feb 2017 11:00:46 -0500 Subject: [PATCH] Fix bottom buttons not working in fullscreen mode Fixes #50 --- src/boe.actions.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/boe.actions.cpp b/src/boe.actions.cpp index a98f7a08..473b2e6a 100644 --- a/src/boe.actions.cpp +++ b/src/boe.actions.cpp @@ -988,22 +988,8 @@ bool handle_action(sf::Event event) { location the_point,point_in_area; the_point = location(event.mouseButton.x, event.mouseButton.y); - the_point.x -= ul.x; - the_point.y -= ul.y; end_scenario = false; - // Now split off the extra stuff, like talking and shopping. - if(overall_mode == MODE_TALKING) { - handle_talk_event(the_point); - if(overall_mode != MODE_TALKING) - return false; - } - if(overall_mode == MODE_SHOPPING) { - handle_shop_event(the_point); - if(overall_mode != MODE_SHOPPING) - return false; - } - // MARK: First, figure out where party is switch(overall_mode) { case MODE_OUTDOORS: case MODE_LOOK_OUTDOORS: @@ -1037,6 +1023,21 @@ bool handle_action(sf::Event event) { return are_done; } + the_point.x -= ul.x; + the_point.y -= ul.y; + + // Now split off the extra stuff, like talking and shopping. + if(overall_mode == MODE_TALKING) { + handle_talk_event(the_point); + if(overall_mode != MODE_TALKING) + return false; + } + if(overall_mode == MODE_SHOPPING) { + handle_shop_event(the_point); + if(overall_mode != MODE_SHOPPING) + return false; + } + // MARK: Then, handle a button being hit. if(button_hit != 12) switch(button_hit) {