From fff1abf012077ea2ae46b1d3de05c10c8797cbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 13 Sep 2026 21:56:17 +0200 Subject: [PATCH] Fixed integer displays in script editor --- ScriptCore/Editor/EntityEditor.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ScriptCore/Editor/EntityEditor.cs b/ScriptCore/Editor/EntityEditor.cs index c9cf0dc..a1b219c 100644 --- a/ScriptCore/Editor/EntityEditor.cs +++ b/ScriptCore/Editor/EntityEditor.cs @@ -282,10 +282,10 @@ internal class EntityEditor if (value is float || value is double || value is Half) format = "0.#####"; else - format = "0"; + format = null; } - if (!format.StartsWith("%")) + if (format?.StartsWith("%") == false) { if (value is float f) { @@ -303,14 +303,14 @@ internal class EntityEditor if (range?.Slider == true) { - if (ImGui.SliderScalar(fieldId, dataType, (IntPtr)(&value), (IntPtr)(&min), (IntPtr)(&max), format)) + if (ImGui.SliderScalar(fieldId, dataType, (IntPtr)(&value), (IntPtr)(&min), (IntPtr)(&max), format, flags: ImGuiSliderFlags.AlwaysClamp)) { newValue = value; } } else { - if (ImGui.DragScalar(fieldId, dataType, (IntPtr)(&value), dragSpeed, (IntPtr)(&min), (IntPtr)(&max), format)) + if (ImGui.DragScalar(fieldId, dataType, (IntPtr)(&value), dragSpeed, (IntPtr)(&min), (IntPtr)(&max), format, flags: ImGuiSliderFlags.AlwaysClamp)) { newValue = value; }