diff options
Diffstat (limited to 'kurator/src/Battle.cpp')
-rw-r--r-- | kurator/src/Battle.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp index d214b89..0eaeac1 100644 --- a/kurator/src/Battle.cpp +++ b/kurator/src/Battle.cpp @@ -1,7 +1,6 @@ #include "Battle.h" #include <algorithm> -#include <functional> #include <cmath> #include <limits> #include <memory> @@ -86,27 +85,22 @@ static void blink_crosses(sim::State& ctx); void Battle::update() { - if (IsKeyPressed(KEY_ESCAPE)) + if (IsKeyPressed(KEY_ESCAPE)) // Move to Controller? return session->set(std::make_shared<Pause>(session, session->current())); - if (IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { - const auto delta = GetMouseDelta(); - ctx.camera.offset.x -= delta.x / ctx.camera.scale; - ctx.camera.offset.y -= delta.y / ctx.camera.scale; - } if (IsWindowResized()) ctx.camera.scale = std::min(GetScreenWidth()/30000.0, GetScreenHeight()/30000.0); ctx.clock.update(); + controller.update(ctx); simulation_base(ctx); - update_markers(ctx, std::bind(&InspectionWindow::select, &inspect, std::placeholders::_1)); + update_markers(ctx, controller); progress_timers(ctx); move_ui_pops(ctx); blink_crosses(ctx); animate_lines(ctx); balance.update(ctx.registry); - inspect.show(); 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)) + if (ImGui::Begin("Controls", nullptr, ImGuiWindowFlags_NoFocusOnAppearing)) // Move to Controller? time_controls("TimeControls", ctx.clock.time_factor); ImGui::End(); } @@ -167,6 +161,7 @@ Battle::draw() const draw_lines(ctx); draw_markers(ctx); draw_pops(ctx); + controller.draw(ctx); balance.draw(); } |