mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 10:20:30 +00:00
fix view beeing temporarily reset in replay viewer
This commit is contained in:
parent
cdb324c9d1
commit
910641db40
@ -1113,12 +1113,7 @@ void play_controller::play_side()
|
||||
//check for team-specific items in the scenario
|
||||
gui_->parse_team_overlays();
|
||||
do {
|
||||
//Update viewing team in case it has changed during the loop.
|
||||
if(int side_num = play_controller::find_last_visible_team()) {
|
||||
if(side_num != this->gui_->viewing_side()) {
|
||||
update_gui_to_player(side_num - 1);
|
||||
}
|
||||
}
|
||||
update_viewing_player();
|
||||
{
|
||||
save_blocker blocker;
|
||||
maybe_do_init_side();
|
||||
|
@ -328,6 +328,7 @@ protected:
|
||||
|
||||
virtual void sync_end_turn() {};
|
||||
virtual void check_time_over();
|
||||
virtual void update_viewing_player() = 0;
|
||||
void play_turn();
|
||||
};
|
||||
|
||||
|
@ -665,3 +665,13 @@ void playsingle_controller::sync_end_turn()
|
||||
assert(end_turn_ == END_TURN_SYNCED);
|
||||
skip_next_turn_ = false;
|
||||
}
|
||||
|
||||
void playsingle_controller::update_viewing_player()
|
||||
{
|
||||
//Update viewing team in case it has changed during the loop.
|
||||
if(int side_num = play_controller::find_last_visible_team()) {
|
||||
if(side_num != this->gui_->viewing_side()) {
|
||||
update_gui_to_player(side_num - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ protected:
|
||||
bool skip_next_turn_;
|
||||
void linger();
|
||||
void sync_end_turn();
|
||||
void update_viewing_player();
|
||||
};
|
||||
|
||||
|
||||
|
@ -530,7 +530,6 @@ bool replay_controller::recorder_at_end() {
|
||||
|
||||
void replay_controller::play_side_impl()
|
||||
{
|
||||
update_teams();
|
||||
stop_condition_->new_side_turn(current_side(), gamestate().tod_manager_.turn());
|
||||
while(true)
|
||||
{
|
||||
@ -559,3 +558,9 @@ void replay_controller::play_side_impl()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void replay_controller::update_viewing_player()
|
||||
{
|
||||
update_gui_to_player(vision_ == HUMAN_TEAM ? gamestate().first_human_team_ : current_side() - 1, vision_ == SHOW_ALL);
|
||||
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
virtual bool is_replay() OVERRIDE { return true; }
|
||||
protected:
|
||||
virtual void init_gui();
|
||||
|
||||
virtual void update_viewing_player();
|
||||
private:
|
||||
enum REPLAY_VISION
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user