From 3b595bb4abdc4fe3a0594fda4afb9ec8ed29d04a Mon Sep 17 00:00:00 2001 From: Khayle Date: Sun, 5 Jan 2025 01:36:35 +0100 Subject: [PATCH 1/3] VFX = 0 Filter for StatusEffects --- .../Controls/Selectors/StatusEffectSelector.cs | 16 +++++++++++++++- Brio/UI/Widgets/Actor/StatusEffectsWidget.cs | 9 +++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs index 48ac21c6..4fe8012c 100644 --- a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs +++ b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs @@ -1,4 +1,5 @@ using Brio.Resources; +using Brio.UI.Widgets.Actor; using Dalamud.Interface.Textures.TextureWraps; using ImGuiNET; using Lumina.Excel.Sheets; @@ -10,11 +11,13 @@ namespace Brio.UI.Controls.Selectors; public class StatusEffectSelectorHolder { public Status Status { get; set; } + public bool _VFXLockEnabled { get; set; } } internal class StatusEffectSelector(string id) : Selector(id) { protected override Vector2 MinimumListSize { get; } = new(300, 300); + public bool _VFXLockEnabled = false; protected override float EntrySize => ImGui.GetTextLineHeight() * 3f; @@ -28,6 +31,17 @@ protected override void PopulateList() } } + protected override void DrawOptions() + { + base.DrawOptions(); + + if(ImGui.Checkbox("###status_vfx_filter", ref this._VFXLockEnabled)) + UpdateList(); + ImGui.SameLine(); + ImGui.Text("Filter out any Status whose VFX value is 0."); + + } + protected override void DrawItem(StatusEffectSelectorHolder sesh, bool isHovered) { var item = sesh.Status; @@ -63,10 +77,10 @@ protected override int Compare(StatusEffectSelectorHolder sesh1, StatusEffectSel protected override bool Filter(StatusEffectSelectorHolder sesh, string search) { var item = sesh.Status; + if(_VFXLockEnabled && item.VFX.RowId == 0) return false; if(item.StatusCategory == 0) return false; - var searchTerm = $"{item.Name} {item.RowId} {item.VFX.RowId} {item.HitEffect.RowId}"; if(searchTerm.Contains(search, StringComparison.InvariantCultureIgnoreCase)) diff --git a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs index 9cde46a2..7518adcb 100644 --- a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs +++ b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs @@ -1,4 +1,5 @@ using Brio.Capabilities.Actor; +using Brio.Capabilities.Core; using Brio.Resources; using Brio.UI.Controls.Selectors; using Brio.UI.Controls.Stateless; @@ -19,6 +20,7 @@ internal class StatusEffectsWidget(StatusEffectCapability capability) : Widget WidgetFlags.DrawBody; private int _selectedStatus; + private bool _VFXLockEnabled = false; private static readonly StatusEffectSelector _globalStatusEffectSelector = new("global_status_selector"); @@ -33,6 +35,7 @@ public override void DrawBody() { foreach(var status in statuses) { + if(_VFXLockEnabled && status.VFX.RowId == 0) break; bool selected = status.RowId == _selectedStatus; IDalamudTextureWrap? tex = null; @@ -78,6 +81,12 @@ public override void DrawBody() if(ImBrio.FontIconButton("status_effects_remove", FontAwesomeIcon.Minus, "Remove Effect", isSelectedPlaying)) Capability.RemoveStatus((ushort)_selectedStatus); + ImGui.SameLine(); + + ImGui.Checkbox("###status_vfx_filter", ref _VFXLockEnabled); + if(ImGui.IsItemHovered()) + ImGui.SetTooltip("Filter out any Status whose VFX value is 0."); + ImGui.SameLine(); From ab7f17cc26c0d7e7530a054efdf5edc707595066 Mon Sep 17 00:00:00 2001 From: Khayle Date: Sun, 5 Jan 2025 02:19:22 +0100 Subject: [PATCH 2/3] Addition ; ExtractText() for names --- Brio/UI/Controls/Selectors/StatusEffectSelector.cs | 2 +- Brio/UI/Widgets/Actor/StatusEffectsWidget.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs index 4fe8012c..d63f7d8e 100644 --- a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs +++ b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs @@ -57,7 +57,7 @@ protected override void DrawItem(StatusEffectSelectorHolder sesh, bool isHovered ImGui.Image(tex.ImGuiHandle, iconSize); ImGui.SameLine(); - ImGui.Text($"{item.Name}\n{item.RowId}\nVFX: {item.VFX.RowId} / Hit: {item.HitEffect.RowId}"); + ImGui.Text($"{item.Name.ExtractText()}\n{item.RowId}\nVFX: {item.VFX.RowId} / Hit: {item.HitEffect.RowId}"); } protected override int Compare(StatusEffectSelectorHolder sesh1, StatusEffectSelectorHolder sesh2) diff --git a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs index 7518adcb..a7adf85d 100644 --- a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs +++ b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs @@ -53,7 +53,7 @@ public override void DrawBody() ImGui.SetCursorPos(position); ImGui.Image(tex.ImGuiHandle, iconSize); ImGui.SameLine(); - ImGui.Text($"{status.Name}\n{status.RowId}"); + ImGui.Text($"{status.Name.ExtractText()}\n{status.RowId}"); if(wasSelected) _selectedStatus = (int)status.RowId; From 17b484de05165e200744854ecb6acddc58fc20f9 Mon Sep 17 00:00:00 2001 From: Kenneth M Date: Sun, 5 Jan 2025 14:00:40 -0600 Subject: [PATCH 3/3] Change some text & make some fixes - Made _VFXLockEnabled true by default - Fixed an issue with `StatusEffectsWidget` foreach loop - Changed the text descriptions --- Brio/UI/Controls/Selectors/StatusEffectSelector.cs | 4 ++-- Brio/UI/Widgets/Actor/StatusEffectsWidget.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs index d63f7d8e..ea0dfcb0 100644 --- a/Brio/UI/Controls/Selectors/StatusEffectSelector.cs +++ b/Brio/UI/Controls/Selectors/StatusEffectSelector.cs @@ -17,7 +17,7 @@ public class StatusEffectSelectorHolder internal class StatusEffectSelector(string id) : Selector(id) { protected override Vector2 MinimumListSize { get; } = new(300, 300); - public bool _VFXLockEnabled = false; + public bool _VFXLockEnabled = true; protected override float EntrySize => ImGui.GetTextLineHeight() * 3f; @@ -38,7 +38,7 @@ protected override void DrawOptions() if(ImGui.Checkbox("###status_vfx_filter", ref this._VFXLockEnabled)) UpdateList(); ImGui.SameLine(); - ImGui.Text("Filter out any Status whose VFX value is 0."); + ImGui.Text("Remove Status Effects that do not have a VFX."); } diff --git a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs index a7adf85d..34c85391 100644 --- a/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs +++ b/Brio/UI/Widgets/Actor/StatusEffectsWidget.cs @@ -35,7 +35,8 @@ public override void DrawBody() { foreach(var status in statuses) { - if(_VFXLockEnabled && status.VFX.RowId == 0) break; + if(_VFXLockEnabled && status.VFX.RowId == 0) continue; + bool selected = status.RowId == _selectedStatus; IDalamudTextureWrap? tex = null; @@ -85,7 +86,7 @@ public override void DrawBody() ImGui.Checkbox("###status_vfx_filter", ref _VFXLockEnabled); if(ImGui.IsItemHovered()) - ImGui.SetTooltip("Filter out any Status whose VFX value is 0."); + ImGui.SetTooltip("Hide Status Effects that have no VFX."); ImGui.SameLine();