feat: show when paused or cancelled and add id opt

This commit is contained in:
Anna 2020-08-19 04:07:17 -04:00
parent 49dd35cc81
commit d58c482c0c
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
1 changed files with 16 additions and 2 deletions

View File

@ -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<Guid, Macro> 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();