Skip to content

Commit

Permalink
Show the turn dialog before updating the GUI for the incoming player.
Browse files Browse the repository at this point in the history
In hotseat games, the main map and minimap were updated and healing was animated
before blacking out the display for the turn dialog.

Fixes #4187.
  • Loading branch information
jostephd committed Aug 10, 2019
1 parent ad9bb8b commit 21ec796
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/play_controller.cpp
Expand Up @@ -1217,6 +1217,10 @@ void play_controller::play_turn()

// If a side is empty skip over it.
if (!current_team().is_empty()) {
// Show the turn dialog now, before the minimap is redrawn and before healing is animated.
if(current_team().is_local_human() && current_team().is_proxy_human()) {
show_turn_dialog();
}
init_side_begin();
if(gamestate_->init_side_done()) {
// This is the case in a reloaded game where the side was initialized before saving the game.
Expand Down
1 change: 1 addition & 0 deletions src/play_controller.hpp
Expand Up @@ -304,6 +304,7 @@ class play_controller : public controller_base, public events::observer, public
void fire_start();
void start_game();
virtual void init_gui();
virtual void show_turn_dialog() {}
void finish_side_turn();
void finish_turn(); //this should not throw an end turn or end level exception
bool enemies_visible() const;
Expand Down
1 change: 0 additions & 1 deletion src/playmp_controller.cpp
Expand Up @@ -122,7 +122,6 @@ void playmp_controller::play_human_turn()
const std::unique_ptr<countdown_clock> timer(saved_game_.mp_settings().mp_countdown
? new countdown_clock(current_team())
: nullptr);
show_turn_dialog();
if(undo_stack().can_undo()) {
// If we reload a networked mp game we cannot undo moves made before the save
// because other players already received them
Expand Down
2 changes: 0 additions & 2 deletions src/playsingle_controller.cpp
Expand Up @@ -458,8 +458,6 @@ void playsingle_controller::execute_gotos()
}

void playsingle_controller::play_human_turn() {
show_turn_dialog();

if (!preferences::disable_auto_moves()) {
execute_gotos();
}
Expand Down
2 changes: 1 addition & 1 deletion src/playsingle_controller.hpp
Expand Up @@ -65,7 +65,7 @@ class playsingle_controller : public play_controller
protected:
virtual void play_side_impl() override;
void before_human_turn();
void show_turn_dialog();
virtual void show_turn_dialog() override;
void execute_gotos();
virtual void play_human_turn();
virtual void after_human_turn();
Expand Down

0 comments on commit 21ec796

Please sign in to comment.