From 5c211a30175ecb3170e8749453af2dc89a05e82b Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 19 Jul 2016 08:15:18 +0100 Subject: [PATCH] Allow closing of mission detail screen by right clicking. --- src/galaxy/galacticMap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/galaxy/galacticMap.c b/src/galaxy/galacticMap.c index 696def0..83943f9 100644 --- a/src/galaxy/galacticMap.c +++ b/src/galaxy/galacticMap.c @@ -280,6 +280,14 @@ static void doStarSystemView(void) return; } } + + /* allow closing by pressing the right mouse button */ + if (app.mouse.button[SDL_BUTTON_RIGHT]) + { + show = SHOW_GALAXY; + + playSound(SND_GUI_CLOSE); + } } static void addPulses(void) @@ -650,7 +658,6 @@ static void handleKeyboard(void) case SHOW_GALAXY: selectWidget("resume", "galacticMap"); show = SHOW_MENU; - playSound(SND_GUI_CLOSE); break; case SHOW_STAR_SYSTEM: @@ -677,6 +684,8 @@ static void handleKeyboard(void) static void handleMouse(void) { + scrollingMap = 0; + if (app.mouse.button[SDL_BUTTON_LEFT]) { if (app.mouse.dx != 0 || app.mouse.dy != 0) @@ -684,10 +693,6 @@ static void handleMouse(void) scrollingMap = 1; } } - else - { - scrollingMap = 0; - } } static void startMission(void)