Permalink
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...
1 parent 2cb9675 commit 2309ee15e0cae765ab690ebe7c0b7d83770fd355 @mattsc mattsc committed Nov 21, 2013
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/replay_controller.cpp
View
@@ -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;
}

0 comments on commit 2309ee1

Please sign in to comment.