From fd6d52d33b94b769bf61c506b436c5e5c0e5e159 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Tue, 12 Nov 2024 20:23:53 -0800 Subject: [PATCH] Extend IconBrowserWidget range Resolves #2074. Co-authored-by: ItsBexy <103910869+itsbexy@users.noreply.github.com> --- .../Windows/Data/Widgets/IconBrowserWidget.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/IconBrowserWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/IconBrowserWidget.cs index 886f5cb19..ff34574b5 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/IconBrowserWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/IconBrowserWidget.cs @@ -17,6 +17,8 @@ namespace Dalamud.Interface.Internal.Windows.Data.Widgets; /// public class IconBrowserWidget : IDataWindowWidget { + private const int MaxIconId = 250_000; + private Vector2 iconSize = new(64.0f, 64.0f); private Vector2 editIconSize = new(64.0f, 64.0f); @@ -24,7 +26,7 @@ public class IconBrowserWidget : IDataWindowWidget private Task>? iconIdsTask; private int startRange; - private int stopRange = 200000; + private int stopRange = MaxIconId; private bool showTooltipImage; private Vector2 mouseDragStart; @@ -53,8 +55,8 @@ public class IconBrowserWidget : IDataWindowWidget { var texm = Service.Get(); - var result = new List<(int ItemId, string Path)>(200000); - for (var iconId = 0; iconId < 200000; iconId++) + var result = new List<(int ItemId, string Path)>(MaxIconId); + for (var iconId = 0; iconId < MaxIconId; iconId++) { // // Remove range 170,000 -> 180,000 by default, this specific range causes exceptions. // if (iconId is >= 170000 and < 180000) @@ -119,12 +121,19 @@ public class IconBrowserWidget : IDataWindowWidget ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X); if (ImGui.InputInt("##StartRange", ref this.startRange, 0, 0)) + { + this.startRange = Math.Clamp(this.startRange, 0, MaxIconId); this.valueRange = null; + } + ImGui.NextColumn(); ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X); if (ImGui.InputInt("##StopRange", ref this.stopRange, 0, 0)) + { + this.stopRange = Math.Clamp(this.stopRange, 0, MaxIconId); this.valueRange = null; + } ImGui.NextColumn(); ImGui.Checkbox("Show Image in Tooltip", ref this.showTooltipImage);