From e015da0447ae20216617913d10db77e9bb18bb6e Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:10:44 -0800 Subject: [PATCH] Improve Dalamud ConsoleWindow plugin search (#1582) * Improve Dalamud ConsoleWindow plugin search * Improve Dalamud ConsoleWindow plugin search * Add `no results` message to plugin filter --- Dalamud/Interface/Internal/Windows/ConsoleWindow.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs index 89dd153cc..770582a30 100644 --- a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs @@ -39,6 +39,7 @@ internal class ConsoleWindow : Window, IDisposable private string commandText = string.Empty; private string textFilter = string.Empty; private string selectedSource = "DalamudInternal"; + private string pluginFilter = string.Empty; private bool filterShowUncaughtExceptions; private bool showFilterToolbar; @@ -475,14 +476,24 @@ internal class ConsoleWindow : Window, IDisposable ImGui.TableNextColumn(); ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X); - if (ImGui.BeginCombo("##Sources", this.selectedSource)) + if (ImGui.BeginCombo("##Sources", this.selectedSource, ImGuiComboFlags.HeightLarge)) { var sourceNames = Service.Get().InstalledPlugins .Select(p => p.Manifest.InternalName) .OrderBy(s => s) .Prepend("DalamudInternal") + .Where(name => this.pluginFilter is "" || new FuzzyMatcher(this.pluginFilter.ToLowerInvariant(), MatchMode.Fuzzy).Matches(name.ToLowerInvariant()) != 0) .ToList(); + ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X); + ImGui.InputTextWithHint("##PluginSearchFilter", "Filter Plugin List", ref this.pluginFilter, 2048); + ImGui.Separator(); + + if (!sourceNames.Any()) + { + ImGui.TextColored(KnownColor.OrangeRed.Vector(), "No Results"); + } + foreach (var selectable in sourceNames) { if (ImGui.Selectable(selectable, this.selectedSource == selectable))