From 5a8801246aca058335ee5dea60b807861e3c6a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Wed, 19 Jul 2023 14:26:35 +0800 Subject: [PATCH] fix: fixed ui stuff. --- ActionTimelineEx/Windows/SettingsWindow.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/ActionTimelineEx/Windows/SettingsWindow.cs b/ActionTimelineEx/Windows/SettingsWindow.cs index 1865675..04b0e11 100644 --- a/ActionTimelineEx/Windows/SettingsWindow.cs +++ b/ActionTimelineEx/Windows/SettingsWindow.cs @@ -41,7 +41,6 @@ public override void Draw() ImGui.EndTabItem(); } - HashSet showedName = new HashSet(); int index = 0; DrawingSettings? removingSetting = null; @@ -49,13 +48,7 @@ public override void Draw() foreach (var setting in Settings.TimelineSettings) { - var duplicated = showedName.Contains(setting.Name); - if (duplicated) ImGui.PushStyleColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DPSRed)); - - var showTab = ImGui.BeginTabItem($"TL:{index}"); - if (duplicated) ImGui.PopStyleColor(); - - if (showTab) + if (ImGui.BeginTabItem($"TL:{index}")) { if (DrawTimelineSetting(setting)) { @@ -63,8 +56,6 @@ public override void Draw() } ImGui.EndTabItem(); } - - showedName.Add(setting.Name); index++; } @@ -135,10 +126,6 @@ private void DrawGeneralSetting() ImGui.DragIntRange2("Clipping Range", ref Settings.PrintClippingMin, ref Settings.PrintClippingMax); } - //ImGui.NewLine(); - - //ImGui.DragFloat("Status checking delay (seconds)", ref Settings.StatusCheckDelay, 0.01f, 0, 1); - ImGui.NewLine(); var index = 0; @@ -318,7 +305,7 @@ private bool RemoveValue(string name) private bool DrawGeneralTab(DrawingSettings settings) { ImGui.InputText("Name: ", ref settings.Name, 32); - var result = RemoveValue(settings.Name); + var result = Plugin.Settings.TimelineSettings.Any() ? RemoveValue(settings.Name) : false; ImGui.Checkbox("Enable", ref settings.Enable); ImGui.Checkbox("Is Rotation", ref settings.IsRotation);