summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-24 00:42:46 +0100
committerAki <please@ignore.pl>2023-02-24 00:42:46 +0100
commit54fdda07eb769df0075784d4f7311ec2ec13fbba (patch)
tree87dee59587f26559da0fe3a17a9c9c458389203c
parent401a7af25e42efc1b451e2467a3b7cde55c30443 (diff)
downloadkurator-54fdda07eb769df0075784d4f7311ec2ec13fbba.zip
kurator-54fdda07eb769df0075784d4f7311ec2ec13fbba.tar.gz
kurator-54fdda07eb769df0075784d4f7311ec2ec13fbba.tar.bz2
Added sliders for Turret Type parameters
-rw-r--r--kurator/src/inspect.cpp18
1 files changed, 17 insertions, 1 deletions
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");
}