From 54fdda07eb769df0075784d4f7311ec2ec13fbba Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 24 Feb 2023 00:42:46 +0100 Subject: Added sliders for Turret Type parameters --- kurator/src/inspect.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kurator/src/inspect.cpp b/kurator/src/inspect.cpp index 8499e44..fa62010 100644 --- a/kurator/src/inspect.cpp +++ b/kurator/src/inspect.cpp @@ -122,11 +122,27 @@ inspect(entt::handle&, universe::ShipType& type) } +static bool +slider_double(const char* label, double* value, double minimum, double maximum, const char* fmt) +{ + return ImGui::SliderScalar(label, ImGuiDataType_Double, value, &minimum, &maximum, fmt); +} + + template <> void inspect(entt::handle&, universe::TurretType& type) { - ImGui::Text("Type: %s", type.name.c_str()); + ImGui::Text("Turret: %s", type.name.c_str()); + ImGui::Text("DPS: %.1f", type.damage_per_second()); + ImGui::Text("Eff. Range: %.1f", type.effective_range()); + ImGui::SliderInt("Rounds", &type.rounds, 0, 50); + slider_double("Base Damage", &type.base_damage, 0, 1000.0, "%.1f"); + slider_double("Rate of Fire", &type.rate_of_fire, 0, 60.0, "%.3f"); + slider_double("Reload", &type.reload, 0, 60.0, "%.3f"); + slider_double("Optimal Range", &type.optimal_range, 0, 30000.0, "%.1f"); + slider_double("Falloff Modifier", &type.falloff_modifier, 0, 1.0, "%.3f"); + slider_double("Falloff Intensity", &type.falloff_intensity, 0, 1.0, "%.3f"); } -- cgit v1.1