Skip to content

Commit

Permalink
Close Spaceship Report when F12 is pressed while it is open
Browse files Browse the repository at this point in the history
  • Loading branch information
blabber committed Jan 8, 2025
1 parent 9468735 commit 6ee66f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/spaceshipdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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<ss_report *>(w);
queen()->game_tab_widget->setCurrentWidget(ss_rep);
}
Expand Down

0 comments on commit 6ee66f1

Please sign in to comment.