From 6ee66f1281d70d42535a360fd17a65b83119a426 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Wed, 8 Jan 2025 21:37:41 +0100 Subject: [PATCH] Close Spaceship Report when F12 is pressed while it is open --- client/spaceshipdlg.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/spaceshipdlg.cpp b/client/spaceshipdlg.cpp index 865674a887..7f3cee6f68 100644 --- a/client/spaceshipdlg.cpp +++ b/client/spaceshipdlg.cpp @@ -16,13 +16,13 @@ // common #include "game.h" +#include "top_bar.h" #include "victory.h" // client #include "client_main.h" #include "colors_common.h" #include "fc_client.h" #include "page_game.h" -#include "qtg_cxxside.h" #include "spaceshipdlg.h" #include "spaceshipdlg_g.h" @@ -198,10 +198,12 @@ void popup_spaceship_dialog(struct player *pplayer) } else { i = queen()->gimmeIndexOf(QStringLiteral("SPS")); fc_assert(i != -1); - if (queen()->game_tab_widget->currentIndex() == i) { + w = queen()->game_tab_widget->widget(i); + if (w->isVisible()) { + top_bar_show_map(); return; } - w = queen()->game_tab_widget->widget(i); + ss_rep = reinterpret_cast(w); queen()->game_tab_widget->setCurrentWidget(ss_rep); }