Disable controller UI while playing a trace
This commit is contained in:
parent
1078d21bd2
commit
646db5b8be
|
@ -192,9 +192,16 @@ void TraceViewer::DrawControllerUI() {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("Skip to last frame");
|
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::SameLine();
|
||||||
ImGui::SliderInt("", &target_frame, 0, player_->frame_count() - 1);
|
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);
|
player_->SeekFrame(target_frame);
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
Loading…
Reference in New Issue