mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Improve Dalamud ConsoleWindow plugin search (#1582)
* Improve Dalamud ConsoleWindow plugin search * Improve Dalamud ConsoleWindow plugin search * Add `no results` message to plugin filter
This commit is contained in:
parent
6eb8153a99
commit
e015da0447
1 changed files with 12 additions and 1 deletions
|
|
@ -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<PluginManager>.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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue