From d58c482c0cb8c77bf64b6c631aa1cffa3a98814c Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Wed, 19 Aug 2020 04:07:17 -0400 Subject: [PATCH] feat: show when paused or cancelled and add id opt --- Custom Commands and Macro Macros/PluginUI.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Custom Commands and Macro Macros/PluginUI.cs b/Custom Commands and Macro Macros/PluginUI.cs index 5ddffc1..ea0afa5 100644 --- a/Custom Commands and Macro Macros/PluginUI.cs +++ b/Custom Commands and Macro Macros/PluginUI.cs @@ -10,7 +10,7 @@ namespace CCMM { private readonly CCMMPlugin plugin; private INode dragged = null; private Guid runningChoice = Guid.Empty; - private uint spawned = 0; + private bool showIdents = false; private bool _settingsVisible = false; public bool SettingsVisible { get => this._settingsVisible; set => this._settingsVisible = value; } @@ -83,7 +83,17 @@ namespace CCMM { ImGui.PushItemWidth(-1f); if (ImGui.ListBoxHeader("##running-macros", this.plugin.MacroHandler.Running.Count, 5)) { foreach (KeyValuePair entry in this.plugin.MacroHandler.Running) { - if (ImGui.Selectable($"{entry.Value.Name}##{entry.Key}", this.runningChoice == entry.Key)) { + string name = $"{entry.Value.Name}"; + if (this.showIdents) { + string ident = entry.Key.ToString(); + name += $" ({ident.Substring(ident.Length - 7)})"; + } + if (this.plugin.MacroHandler.IsPaused(entry.Key)) { + name += " (paused)"; + } + bool cancalled = this.plugin.MacroHandler.IsCancelled(entry.Key); + ImGuiSelectableFlags flags = cancalled ? ImGuiSelectableFlags.Disabled : ImGuiSelectableFlags.None; + if (ImGui.Selectable($"{name}##{entry.Key}", this.runningChoice == entry.Key, flags)) { this.runningChoice = entry.Key; } } @@ -107,6 +117,10 @@ namespace CCMM { } } + ImGui.SameLine(); + + ImGui.Checkbox("Show unique identifiers", ref this.showIdents); + ImGui.Columns(1); ImGui.End();