Disable controller UI while playing a trace

This commit is contained in:
Dr. Chat 2015-11-22 09:54:25 -06:00
parent 1078d21bd2
commit 646db5b8be
1 changed files with 8 additions and 1 deletions

View File

@ -192,9 +192,16 @@ void TraceViewer::DrawControllerUI() {
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Skip to last frame");
}
if (player_->playing_trace()) {
// Don't allow the user to change the frame index just yet...
// TODO: Find a way to disable the slider below.
target_frame = player_->current_frame_index();
}
ImGui::SameLine();
ImGui::SliderInt("", &target_frame, 0, player_->frame_count() - 1);
if (target_frame != player_->current_frame_index()) {
if (target_frame != player_->current_frame_index() &&
!player_->playing_trace()) {
player_->SeekFrame(target_frame);
}
ImGui::End();