Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replays: disable the play/stop buttons after end of replay

The diverse play buttons and the stop button should be disabled when
the end of the replay is reached (which is also how it is in 1.10).
Other replay buttons remain active.
  • Loading branch information...
commit 2309ee15e0cae765ab690ebe7c0b7d83770fd355 1 parent 2cb9675
@mattsc mattsc authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/replay_controller.cpp
View
15 src/replay_controller.cpp
@@ -512,11 +512,7 @@ bool replay_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
switch(command) {
//commands we can always do
- case hotkey::HOTKEY_PLAY_REPLAY:
case hotkey::HOTKEY_RESET_REPLAY:
- case hotkey::HOTKEY_STOP_REPLAY:
- case hotkey::HOTKEY_REPLAY_NEXT_TURN:
- case hotkey::HOTKEY_REPLAY_NEXT_SIDE:
case hotkey::HOTKEY_REPLAY_SHOW_EVERYTHING:
case hotkey::HOTKEY_REPLAY_SHOW_EACH:
case hotkey::HOTKEY_REPLAY_SHOW_TEAM1:
@@ -526,6 +522,17 @@ bool replay_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
case hotkey::HOTKEY_CHAT_LOG:
return true;
+ //commands we only can do before the end of the replay
+ case hotkey::HOTKEY_PLAY_REPLAY:
+ case hotkey::HOTKEY_STOP_REPLAY:
+ case hotkey::HOTKEY_REPLAY_NEXT_TURN:
+ case hotkey::HOTKEY_REPLAY_NEXT_SIDE:
+ if(recorder.at_end()) {
+ return false;
+ } else {
+ return true;
+ }
+
default:
return result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.