Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed ui stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 19, 2023
1 parent e47e09a commit 5a88012
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,21 @@ public override void Draw()
ImGui.EndTabItem();
}

HashSet<string> showedName = new HashSet<string>();
int index = 0;
DrawingSettings? removingSetting = null;

if (!Settings.TimelineSettings.Any()) Settings.TimelineSettings.Add(new DrawingSettings());

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))
{
removingSetting = setting;
}
ImGui.EndTabItem();
}

showedName.Add(setting.Name);
index++;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5a88012

Please sign in to comment.