Skip to content

Commit

Permalink
replay: Set 'skip animation' button when pressing its hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
jostephd authored and GregoryLundberg committed Nov 30, 2017
1 parent 386336c commit 0f4cabc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/play_controller.cpp
Expand Up @@ -1263,3 +1263,12 @@ void play_controller::show_objectives() const
gui2::show_transient_message(gui_->video(), get_scenario_name(), (objectives.empty() ? no_objectives : objectives), "", true);
t.reset_objectives_changed();
}

void play_controller::toggle_skipping_replay()
{
skip_replay_ = !skip_replay_;
const std::shared_ptr<gui::button> skip_animation_button = get_display().find_action_button("skip-animation");
if (skip_animation_button) {
skip_animation_button->set_check(skip_replay_);
}
}
2 changes: 1 addition & 1 deletion src/play_controller.hpp
Expand Up @@ -186,7 +186,7 @@ class play_controller : public controller_base, public events::observer, public
config to_config() const;

bool is_skipping_replay() const { return skip_replay_; }
void toggle_skipping_replay() { skip_replay_ = !skip_replay_; }
void toggle_skipping_replay();
bool is_linger_mode() const { return linger_; }
void do_autosave();

Expand Down

0 comments on commit 0f4cabc

Please sign in to comment.