diff options
-rw-r--r-- | kurator/src/Battle.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp index 9ec2bdd..6c86c25 100644 --- a/kurator/src/Battle.cpp +++ b/kurator/src/Battle.cpp @@ -2,6 +2,7 @@ #include <algorithm> #include <cmath> +#include <limits> #include <memory> #include <string> #include <utility> @@ -72,8 +73,16 @@ Battle::update(const float dt) pop.speed.y -= damp.y; } balance.update(registry); - ImGui::Begin("Controls"); - ImGui::SliderFloat("Time Factor", &time_factor, 0.1f, 3.0f); + ImGui::SetNextWindowPos({GetScreenWidth()/2.0f, GetScreenHeight()-100.0f}, ImGuiCond_Once, {0.5f, 0.5f}); + ImGui::SetNextWindowSize({240.0f, 0.0f}, ImGuiCond_Once); + if (ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_NoFocusOnAppearing)) { + ImGui::PushItemWidth(-std::numeric_limits<float>::min()); + if (ImGui::Button("1x")) + time_factor = 1.0f; + ImGui::SameLine(); + ImGui::SliderFloat("##time_factor", &time_factor, 0.1f, 10.0f); + ImGui::PopItemWidth(); + } ImGui::End(); if (IsKeyPressed(KEY_SPACE)) session->set(std::make_shared<Log>(session, log)); |