| 100 | } |
| 101 | |
| 102 | void TemporalControlWindow::processTpsRestriction() |
| 103 | { |
| 104 | AlienImGui::ToggleButton(AlienImGui::ToggleButtonParameters().name("Slow down"), _slowDown); |
| 105 | ImGui::SameLine(scale(LeftColumnWidth) - (ImGui::GetWindowWidth() - ImGui::GetContentRegionAvail().x)); |
| 106 | ImGui::BeginDisabled(!_slowDown); |
| 107 | ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); |
| 108 | ImGui::SliderInt("##TPSRestriction", &_tpsRestriction, 1, 1000, "%d TPS", ImGuiSliderFlags_Logarithmic); |
| 109 | if (_slowDown) { |
| 110 | _simulationFacade->setTpsRestriction(_tpsRestriction); |
| 111 | } else { |
| 112 | _simulationFacade->setTpsRestriction(std::nullopt); |
| 113 | } |
| 114 | ImGui::PopItemWidth(); |
| 115 | ImGui::EndDisabled(); |
| 116 | |
| 117 | auto syncSimulationWithRendering = _simulationFacade->isSyncSimulationWithRendering(); |
| 118 | if (AlienImGui::ToggleButton(AlienImGui::ToggleButtonParameters().name("Sync with rendering"), syncSimulationWithRendering)) { |
| 119 | _simulationFacade->setSyncSimulationWithRendering(syncSimulationWithRendering); |
| 120 | } |
| 121 | |
| 122 | ImGui::BeginDisabled(!syncSimulationWithRendering); |
| 123 | ImGui::SameLine(scale(LeftColumnWidth) - (ImGui::GetWindowWidth() - ImGui::GetContentRegionAvail().x)); |
| 124 | auto syncSimulationWithRenderingRatio = _simulationFacade->getSyncSimulationWithRenderingRatio(); |
| 125 | if (AlienImGui::SliderInt(AlienImGui::SliderIntParameters().textWidth(0).min(1).max(40).logarithmic(true).format("%d TPS : FPS"), &syncSimulationWithRenderingRatio)) { |
| 126 | _simulationFacade->setSyncSimulationWithRenderingRatio(syncSimulationWithRenderingRatio); |
| 127 | } |
| 128 | ImGui::EndDisabled(); |
| 129 | } |
| 130 | |
| 131 | void TemporalControlWindow::processRunButton() |
| 132 | { |
nothing calls this directly
no test coverage detected