From 355bc26e9fb9e5f274c6139a56541471d091e528 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 24 Feb 2025 13:22:49 -0800 Subject: [PATCH 1/5] Search bar because fuck scrolling --- BossMod/Config/ModuleViewer.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index 542724ff4..c437307c3 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -1,6 +1,7 @@ using BossMod.Autorotation; using Dalamud.Interface; using Dalamud.Interface.Utility.Raii; +using Dalamud.Utility; using ImGuiNET; using Lumina.Excel.Sheets; using Lumina.Text.ReadOnly; @@ -29,6 +30,8 @@ private record struct ModuleGroup(ModuleGroupInfo Info, List Modules private readonly List[,] _groups; private readonly Vector2 _iconSize = new(30, 30); + private string _searchText = ""; + public ModuleViewer(PlanDatabase? planDB, WorldState ws) { _planDB = planDB; @@ -132,6 +135,11 @@ private void DrawFilters() if (!table) return; + ImGui.TableNextColumn(); + ImGui.Text("Search:"); + ImGui.SameLine(); + ImGui.InputTextWithHint("##search", "e.g. \"Ultimate\"", ref _searchText, 100, ImGuiInputTextFlags.CallbackCompletion); + ImGui.TableNextColumn(); ImGui.TableHeader("Expansion"); ImGui.TableNextRow(ImGuiTableRowFlags.None); @@ -200,6 +208,9 @@ private void DrawModules(UITree tree, WorldState ws) foreach (var group in _groups[i, j]) { + if (!_searchText.IsNullOrEmpty() && !group.Info.Name.Contains(_searchText, StringComparison.OrdinalIgnoreCase)) + continue; + ImGui.TableNextRow(); ImGui.TableNextColumn(); UIMisc.Image(Service.Texture?.GetFromGameIcon(_expansions[i].icon), new(36)); From 32354817006e470173628eb1d7afeee97b2cd581 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 24 Feb 2025 13:50:27 -0800 Subject: [PATCH 2/5] the text isn't aligned --- BossMod/Config/ModuleViewer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index c437307c3..42a125887 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -136,8 +136,10 @@ private void DrawFilters() return; ImGui.TableNextColumn(); + ImGui.AlignTextToFramePadding(); // Ensures text aligns with input box ImGui.Text("Search:"); ImGui.SameLine(); + ImGui.SetNextItemWidth(-1); // Makes the input box take up the rest of the row ImGui.InputTextWithHint("##search", "e.g. \"Ultimate\"", ref _searchText, 100, ImGuiInputTextFlags.CallbackCompletion); ImGui.TableNextColumn(); From 914ae86f0af09fcc393221068ffab085c64ec3b4 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 24 Feb 2025 14:08:46 -0800 Subject: [PATCH 3/5] the text is aligned --- BossMod/Config/ModuleViewer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index 42a125887..e1783dbcc 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -136,11 +136,13 @@ private void DrawFilters() return; ImGui.TableNextColumn(); - ImGui.AlignTextToFramePadding(); // Ensures text aligns with input box + ImGui.TableNextColumn(); //spacing with only one seemed to be a bit small on certain window sizes + ImGui.AlignTextToFramePadding(); ImGui.Text("Search:"); ImGui.SameLine(); - ImGui.SetNextItemWidth(-1); // Makes the input box take up the rest of the row + ImGui.SetNextItemWidth(-1); ImGui.InputTextWithHint("##search", "e.g. \"Ultimate\"", ref _searchText, 100, ImGuiInputTextFlags.CallbackCompletion); + ImGui.TableNextColumn(); ImGui.TableNextColumn(); ImGui.TableHeader("Expansion"); From a136b89c2f33793f37c9c29c553b23b584d42515 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 24 Feb 2025 14:51:28 -0800 Subject: [PATCH 4/5] cute lil tooltip --- BossMod/Config/ModuleViewer.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index e1783dbcc..56b2678c4 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -141,7 +141,7 @@ private void DrawFilters() ImGui.Text("Search:"); ImGui.SameLine(); ImGui.SetNextItemWidth(-1); - ImGui.InputTextWithHint("##search", "e.g. \"Ultimate\"", ref _searchText, 100, ImGuiInputTextFlags.CallbackCompletion); + DrawSearchBar(); ImGui.TableNextColumn(); ImGui.TableNextColumn(); @@ -159,6 +159,19 @@ private void DrawFilters() DrawContentTypeFilters(); } + private void DrawSearchBar() + { + ImGui.InputTextWithHint("##search", "e.g. \"Ultimate\"", ref _searchText, 100, ImGuiInputTextFlags.CallbackCompletion); + + if (ImGui.IsItemHovered() && !ImGui.IsItemFocused()) + { + ImGui.BeginTooltip(); + ImGui.Text("Type here to search for any specific instance by its respective title."); + ImGui.EndTooltip(); + } + } + + private void DrawExpansionFilters() { for (var e = BossModuleInfo.Expansion.RealmReborn; e < BossModuleInfo.Expansion.Count; ++e) From e0e543508103184232dca59d01ead809671cf919 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 24 Feb 2025 15:26:16 -0800 Subject: [PATCH 5/5] warning --- BossMod/Config/ModuleViewer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index 56b2678c4..6c9a6eeb6 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -171,7 +171,6 @@ private void DrawSearchBar() } } - private void DrawExpansionFilters() { for (var e = BossModuleInfo.Expansion.RealmReborn; e < BossModuleInfo.Expansion.Count; ++e)