diff --git a/RotationSolver.Basic/Data/IconSet.cs b/RotationSolver.Basic/Data/IconSet.cs
index 8738446ef..c05a1e682 100644
--- a/RotationSolver.Basic/Data/IconSet.cs
+++ b/RotationSolver.Basic/Data/IconSet.cs
@@ -3,8 +3,6 @@
using ECommons.ExcelServices;
using ECommons.ImGuiMethods;
using Lumina.Excel.GeneratedSheets;
-using Svg;
-using System.Drawing.Imaging;
using XIVConfigUI;
namespace RotationSolver.Basic.Data;
@@ -80,60 +78,13 @@ public enum IconType : byte
///
public static class IconSet
{
- ///
- /// Init for svg rendering.
- ///
- public static void InIt()
- {
- ThreadLoadImageHandler.AddConversionToBitmap(SvgToPng);
- }
-
- private static byte[] SvgToPng(byte[] data)
- {
- using var stream = new MemoryStream(data);
- using var outStream = new MemoryStream();
- var svgDocument = SvgDocument.Open(stream);
- using var bitmap = svgDocument.Draw();
- bitmap.Save(outStream, ImageFormat.Png);
- return outStream.ToArray();
- }
-
///
///
///
///
///
///
- public static bool GetTexture(this ITexture text, out IDalamudTextureWrap texture) => GetTexture(text?.IconID ?? 0, out texture);
-
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public static bool GetTexture(uint id, out IDalamudTextureWrap texture, uint @default = 0)
- => ThreadLoadImageHandler.TryGetIconTextureWrap(id, true, out texture)
- || ThreadLoadImageHandler.TryGetIconTextureWrap(id, false, out texture)
- || ThreadLoadImageHandler.TryGetIconTextureWrap(@default, true, out texture)
- || ThreadLoadImageHandler.TryGetIconTextureWrap(@default, false, out texture)
- || ThreadLoadImageHandler.TryGetIconTextureWrap(0, true, out texture);
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public static bool GetTexture(string path, out IDalamudTextureWrap texture, bool loadingIcon = false)
- => ThreadLoadImageHandler.TryGetTextureWrap(path, out texture)
- || loadingIcon && ThreadLoadImageHandler.TryGetTextureWrap("ui/uld/image2.tex", out texture)
- || ThreadLoadImageHandler.TryGetIconTextureWrap(0, false, out texture); // loading pics.
-
- private static readonly Dictionary _actionIcons = [];
+ public static bool GetTexture(this ITexture text, out IDalamudTextureWrap texture) => ImageLoader.GetTexture(text?.IconID ?? 0, out texture);
///
///
@@ -150,7 +101,7 @@ public static bool GetTexture(this IAction? action, out IDalamudTextureWrap text
}
else
{
- return GetTexture(action?.IconID ?? 0, out texture, 0);
+ return ImageLoader.GetTexture(action?.IconID ?? 0, out texture, 0);
}
}
@@ -160,7 +111,7 @@ public static bool GetTexture(this IAction? action, out IDalamudTextureWrap text
///
///
///
- public static bool GetTexture(this ActionID actionID, out IDalamudTextureWrap texture) => XIVConfigUIMain.GetTextureAction((uint)actionID, out texture);
+ public static bool GetTexture(this ActionID actionID, out IDalamudTextureWrap texture) => ImageLoader.GetTextureAction((uint)actionID, out texture);
private static readonly Dictionary _icons = new()
diff --git a/RotationSolver.Basic/Data/UiString.cs b/RotationSolver.Basic/Data/UiString.cs
index 0d5d63d76..75a427817 100644
--- a/RotationSolver.Basic/Data/UiString.cs
+++ b/RotationSolver.Basic/Data/UiString.cs
@@ -16,9 +16,6 @@ internal enum UiString
[Description("Load From folder.")]
ActionSequencer_Load,
- [Description("Analyses PvE combat information in every frame and finds the best action.")]
- ConfigWindow_About_Punchline,
-
[Description("Game")]
ConfigWindow_Helper_GameVersion,
@@ -37,9 +34,6 @@ internal enum UiString
[Description("You're tiring RS out, give it a break!")]
ConfigWindow_About_Clicking500k,
- [Description("This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.")]
- ConfigWindow_About_Description,
-
[Description("It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.")]
ConfigWindow_About_Warning,
diff --git a/RotationSolver.Basic/RotationSolver.Basic.csproj b/RotationSolver.Basic/RotationSolver.Basic.csproj
index d649e7db0..15512e515 100644
--- a/RotationSolver.Basic/RotationSolver.Basic.csproj
+++ b/RotationSolver.Basic/RotationSolver.Basic.csproj
@@ -70,10 +70,6 @@
-
- all
-
-
True
\
diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json
index a59bd1560..f6577e3c2 100644
--- a/RotationSolver/Localization/Localization.json
+++ b/RotationSolver/Localization/Localization.json
@@ -24,14 +24,12 @@
"RotationSolver.Data.UiString.ActionAttack": "Attack",
"RotationSolver.Data.UiString.ActionAbility": "Ability",
"RotationSolver.Data.UiString.ActionFriendly": "Friendly",
- "RotationSolver.Data.UiString.ConfigWindow_About_Punchline": "Analyses PvE combat information in every frame and finds the best action.",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!",
"RotationSolver.Data.UiString.ConfigWindow_Helper_GameVersion": "Game",
"RotationSolver.Data.UiString.ConfigWindow_Helper_SwitchRotation": "Click to switch rotations",
"RotationSolver.Data.UiString.ConfigWindow_ConditionSetDesc": "The condition set you chose, click to modify.",
"RotationSolver.Data.UiString.ConfigWindow_Searching": "Search... ",
- "RotationSolver.Data.UiString.ConfigWindow_About_Description": "This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.",
"RotationSolver.Data.UiString.ConfigWindow_About_Warning": "It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.",
"RotationSolver.Data.UiString.ConfigWindow_About_ClickingCount": "Rotation Solver helped you by clicking actions {0:N0} times.",
"RotationSolver.Data.UiString.ConfigWindow_About_SayHelloCount": "You have said hello to other users {0:N0} times!",
diff --git a/RotationSolver/RotationSolverPlugin.cs b/RotationSolver/RotationSolverPlugin.cs
index e75a7a21d..dacab212a 100644
--- a/RotationSolver/RotationSolverPlugin.cs
+++ b/RotationSolver/RotationSolverPlugin.cs
@@ -38,7 +38,6 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
{
ECommonsMain.Init(pluginInterface, this, ECommons.Module.DalamudReflector, ECommons.Module.ObjectFunctions);
ThreadLoadImageHandler.TryGetIconTextureWrap(0, true, out _);
- IconSet.InIt();
_dis.Add(new Service());
try
diff --git a/RotationSolver/UI/ConditionDrawer.cs b/RotationSolver/UI/ConditionDrawer.cs
index 115e23186..d04d6dbbe 100644
--- a/RotationSolver/UI/ConditionDrawer.cs
+++ b/RotationSolver/UI/ConditionDrawer.cs
@@ -34,7 +34,7 @@ internal static void DrawCondition(bool? tag, string id, ref bool isNot)
float size = IconSize * (1 + 8 / 82);
if (!tag.HasValue)
{
- if (IconSet.GetTexture("ui/uld/image2.tex", out var texture, true) || IconSet.GetTexture(0u, out texture))
+ if (ImageLoader.GetTexture("ui/uld/image2.tex", out var texture) || IconSet.GetTexture(0u, out texture))
{
if (ImGuiHelper.SilenceImageButton(texture.ImGuiHandle, Vector2.One * size, false, id))
{
@@ -46,7 +46,7 @@ internal static void DrawCondition(bool? tag, string id, ref bool isNot)
}
else
{
- if (IconSet.GetTexture("ui/uld/readycheck_hr1.tex", out var texture, true))
+ if (ImageLoader.GetTexture("ui/uld/readycheck_hr1.tex", out var texture))
{
if (ImGuiHelper.SilenceImageButton(texture.ImGuiHandle, Vector2.One * size,
new Vector2(tag.Value ? 0 : 0.5f, 0),
@@ -65,14 +65,14 @@ internal static void DrawCondition(bool? tag)
if (!tag.HasValue)
{
- if (IconSet.GetTexture("ui/uld/image2.tex", out var texture, true) || IconSet.GetTexture(0u, out texture))
+ if (ImageLoader.GetTexture("ui/uld/image2.tex", out var texture) || IconSet.GetTexture(0u, out texture))
{
ImGui.Image(texture.ImGuiHandle, Vector2.One * size);
}
}
else
{
- if (IconSet.GetTexture("ui/uld/readycheck_hr1.tex", out var texture, true))
+ if (ImageLoader.GetTexture("ui/uld/readycheck_hr1.tex", out var texture))
{
ImGui.Image(texture.ImGuiHandle, Vector2.One * size,
new Vector2(tag.Value ? 0 : 0.5f, 0),
@@ -360,7 +360,7 @@ private static void DrawAfter(this TraitCondition traitCondition, ICustomRotatio
}
}
- if (traitCondition._trait?.GetTexture(out var icon) ?? false || IconSet.GetTexture(4, out icon))
+ if (traitCondition._trait?.GetTexture(out var icon) ?? false || ImageLoader.GetTexture(4, out icon))
{
var cursor = ImGui.GetCursorPos();
if (ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, Vector2.One * IconSize, traitCondition.GetHashCode().ToString()))
@@ -394,7 +394,7 @@ private static void DrawAfter(this ActionCondition actionCondition, ICustomRotat
ActionSelectorPopUp(popUpKey, _actionsList, rotation, item => actionCondition.ID = (ActionID)item.ID);
- if ((actionCondition._action?.GetTexture(out var icon) ?? false) || IconSet.GetTexture(4, out icon))
+ if ((actionCondition._action?.GetTexture(out var icon) ?? false) || ImageLoader.GetTexture(4, out icon))
{
var cursor = ImGui.GetCursorPos();
if (ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, Vector2.One * IconSize, actionCondition.GetHashCode().ToString()))
@@ -645,7 +645,7 @@ private static void DrawAfter(this RotationCondition rotationCondition, ICustomR
ActionSelectorPopUp(popUpKey, _actionsList, rotation, item => rotationCondition.ID = (ActionID)item.ID);
- if (rotationCondition._action?.GetTexture(out var icon) ?? false || IconSet.GetTexture(4, out icon))
+ if (rotationCondition._action?.GetTexture(out var icon) ?? false || ImageLoader.GetTexture(4, out icon))
{
var cursor = ImGui.GetCursorPos();
if (ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, Vector2.One * IconSize, rotationCondition.GetHashCode().ToString()))
@@ -705,8 +705,8 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat
}
});
- if (targetCondition._action != null ? targetCondition._action.GetTexture(out var icon) || IconSet.GetTexture(4, out icon)
- : IconSet.GetTexture(targetCondition.TargetType switch
+ if (targetCondition._action != null ? targetCondition._action.GetTexture(out var icon) || ImageLoader.GetTexture(4, out icon)
+ : ImageLoader.GetTexture(targetCondition.TargetType switch
{
TargetType.Target => 16u,
TargetType.HostileTarget => 15u,
@@ -739,8 +739,8 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat
void DrawStatusIcon()
{
- if (IconSet.GetTexture(targetCondition.Status?.Icon ?? 16220, out var icon)
- || IconSet.GetTexture(16220, out icon))
+ if (ImageLoader.GetTexture(targetCondition.Status?.Icon ?? 16220, out var icon)
+ || ImageLoader.GetTexture(16220, out icon))
{
if (ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, new Vector2(IconSize * 3 / 4, IconSize) * ImGuiHelpers.GlobalScale, targetCondition.GetHashCode().ToString()))
{
diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs
index 79292a737..e3567026e 100644
--- a/RotationSolver/UI/ControlWindow.cs
+++ b/RotationSolver/UI/ControlWindow.cs
@@ -305,7 +305,7 @@ static void DrawCommandAction(IAction? ability, SpecialCommandType command, Vect
static void DrawCommandAction(uint iconId, SpecialCommandType command, Vector4 color)
{
- if (IconSet.GetTexture(iconId, out var texture)) DrawCommandAction(texture, command, color);
+ if (ImageLoader.GetTexture(iconId, out var texture)) DrawCommandAction(texture, command, color);
}
static void DrawCommandAction(IDalamudTextureWrap texture, SpecialCommandType command, Vector4 color, string helpAddition = "")
@@ -375,12 +375,11 @@ static void DrawCommandAction(uint iconId, StateCommandType command, Vector4 col
var help = command.Local();
string baseId = "ImgButton" + command.ToString();
- if (IconSet.GetTexture(iconId, out var texture))
+ if (ImageLoader.GetTexture(iconId, out var texture))
{
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + Math.Max(0, strWidth / 2 - width / 2));
DrawIAction(texture.ImGuiHandle, baseId, abilityW, command, help);
}
-
}
}
diff --git a/RotationSolver/UI/PainterManager.cs b/RotationSolver/UI/PainterManager.cs
index f338e3c69..b1a15d5ca 100644
--- a/RotationSolver/UI/PainterManager.cs
+++ b/RotationSolver/UI/PainterManager.cs
@@ -4,6 +4,7 @@
using ECommons.GameHelpers;
using RotationSolver.Basic.Configuration;
using RotationSolver.Updaters;
+using XIVConfigUI;
using XIVDrawer;
using XIVDrawer.Element3D;
using XIVDrawer.ElementSpecial;
@@ -127,7 +128,7 @@ public static void Init()
if (DataCenter.State && Service.Config.ShowStateIcon)
{
- if (IconSet.GetTexture(61516, out var texture))
+ if (ImageLoader.GetTexture(61516, out var texture))
{
_stateImage.Image = texture;
_stateImage.Size = Service.Config.StateIconSize;
@@ -227,7 +228,7 @@ private static unsafe void UpdateHostileIcons()
return;
}
- if (!IconSet.GetTexture(61510, out var hostileIcon)) return;
+ if (!ImageLoader.GetTexture(61510, out var hostileIcon)) return;
for (int i = 0; i < Math.Min(TargetsDrawings.Length, DataCenter.AllHostileTargets.Length); i++)
{
diff --git a/RotationSolver/UI/RotationConfigWindow.cs b/RotationSolver/UI/RotationConfigWindow.cs
index 02db26110..693a4c6e5 100644
--- a/RotationSolver/UI/RotationConfigWindow.cs
+++ b/RotationSolver/UI/RotationConfigWindow.cs
@@ -30,10 +30,6 @@ namespace RotationSolver.UI;
public class RotationConfigWindow : ConfigWindow
{
- protected override string Punchline => UiString.ConfigWindow_About_Punchline.Local();
-
- protected override string Description => UiString.ConfigWindow_About_Description.Local();
-
public override SearchableCollection AllSearchable { get; } = new(Service.Config, new()
{
{nameof(Configs.AutoHeal), p => new AutoHealCheckBox(p, Service.Config) }
@@ -311,7 +307,7 @@ private void DrawRotationIcon(ICustomRotation rotation, float iconSize)
});
}
- if (IconSet.GetTexture(rotation.GetType().GetCustomAttribute()!.Type.GetIcon(), out var texture))
+ if (ImageLoader.GetTexture(rotation.GetType().GetCustomAttribute()!.Type.GetIcon(), out var texture))
{
ImGui.SetCursorPos(cursor + Vector2.One * iconSize / 2);
@@ -342,7 +338,7 @@ private static void DrawRotationCombo(float comboSize, Type[] rotations, ICustom
{
var rAttr = r.GetCustomAttribute()!;
- if (IconSet.GetTexture(rAttr.Type.GetIcon(), out var texture))
+ if (ImageLoader.GetTexture(rAttr.Type.GetIcon(), out var texture))
{
ImGui.Image(texture.ImGuiHandle, Vector2.One * 20 * Scale);
if (ImGui.IsItemHovered())
@@ -390,7 +386,7 @@ public abstract class ConfigWindowItemRS : ConfigWindowItem
public sealed override bool GetIcon(out IDalamudTextureWrap texture)
{
- return IconSet.GetTexture(Icon, out texture);
+ return ImageLoader.GetTexture(Icon, out texture);
}
}
@@ -550,7 +546,7 @@ private static void DrawAboutCompatibility()
var icon = item.Icon;
if (string.IsNullOrEmpty(icon)) icon = "https://raw.githubusercontent.com/goatcorp/DalamudAssets/master/UIRes/defaultIcon.png";
- if (IconSet.GetTexture(icon, out var texture))
+ if (ImageLoader.GetTexture(icon, out var texture))
{
if (ImGuiHelper.NoPaddingNoColorImageButton(texture.ImGuiHandle, Vector2.One * iconSize))
{
@@ -602,12 +598,12 @@ private static void DrawAboutLinks()
{
var width = ImGui.GetWindowWidth();
- if (IconSet.GetTexture("https://GitHub-readme-stats.vercel.app/api/pin/?username=ArchiDog1998&repo=RotationSolver&theme=dark", out var icon) && ImGuiHelper.TextureButton(icon, width, width))
+ if (ImageLoader.GetTexture("https://GitHub-readme-stats.vercel.app/api/pin/?username=ArchiDog1998&repo=RotationSolver&theme=dark", out var icon) && ImGuiHelper.TextureButton(icon, width, width))
{
Util.OpenLink($"https://GitHub.com/{Service.USERNAME}/{Service.REPO}");
}
- if (IconSet.GetTexture("https://badges.crowdin.net/badge/light/crowdin-on-dark.png", out icon) && ImGuiHelper.TextureButton(icon, width, width))
+ if (ImageLoader.GetTexture("https://badges.crowdin.net/badge/light/crowdin-on-dark.png", out icon) && ImGuiHelper.TextureButton(icon, width, width))
{
Util.OpenLink("https://crowdin.com/project/rotationsolver");
}
@@ -681,7 +677,7 @@ public override void Draw(ConfigWindow window)
if (!string.IsNullOrEmpty(info.DonateLink))
{
- if (IconSet.GetTexture("https://storage.ko-fi.com/cdn/brandasset/kofi_button_red.png", out var icon) && ImGuiHelper.TextureButton(icon, wholeWidth, 250 * Scale, "Ko-fi link"))
+ if (ImageLoader.GetTexture("https://storage.ko-fi.com/cdn/brandasset/kofi_button_red.png", out var icon) && ImGuiHelper.TextureButton(icon, wholeWidth, 250 * Scale, "Ko-fi link"))
{
Util.OpenLink(info.DonateLink);
}
@@ -728,7 +724,7 @@ private static void DrawRotationDescription()
ImGui.TableNextRow();
ImGui.TableNextColumn();
- if (IconSet.GetTexture(attr.IconID, out var image)) ImGui.Image(image.ImGuiHandle, Vector2.One * DESC_SIZE * Scale);
+ if (ImageLoader.GetTexture(attr.IconID, out var image)) ImGui.Image(image.ImGuiHandle, Vector2.One * DESC_SIZE * Scale);
ImGui.SameLine();
var isOnCommand = attr.IsOnCommand;
@@ -1011,7 +1007,7 @@ private static void DrawRotationInformation()
if (!string.IsNullOrEmpty(youtubeLink))
{
ImGui.NewLine();
- if (IconSet.GetTexture("https://www.gstatic.com/youtube/img/branding/youtubelogo/svg/youtubelogo.svg", out var icon) && ImGuiHelper.TextureButton(icon, wholeWidth, 250 * Scale, "Youtube Link"))
+ if (ImageLoader.GetTexture("https://www.gstatic.com/youtube/img/branding/youtubelogo/svg/youtubelogo.svg", out var icon) && ImGuiHelper.TextureButton(icon, wholeWidth, 250 * Scale, "Youtube Link"))
{
Util.OpenLink("https://www.youtube.com/watch?v=" + youtubeLink);
}
@@ -1072,7 +1068,7 @@ private static void DrawRotationInformation()
internal static void DrawLinkDescription(LinkDescription link, float wholeWidth, bool drawQuestion)
{
- var hasTexture = IconSet.GetTexture(link.Url, out var texture);
+ var hasTexture = ImageLoader.GetTexture(link.Url, out var texture);
if (hasTexture && ImGuiHelper.TextureButton(texture, wholeWidth, wholeWidth))
{
@@ -1138,7 +1134,7 @@ public override unsafe void Draw(ConfigWindow window)
}
ImGuiHelper.DrawActionOverlay(cursor, size, _activeAction == item ? 1 : 0);
- if (IconSet.GetTexture("ui/uld/readycheck_hr1.tex", out var texture))
+ if (ImageLoader.GetTexture("ui/uld/readycheck_hr1.tex", out var texture))
{
var offset = new Vector2(1 / 12f, 1 / 6f);
ImGui.SetCursorPos(cursor + new Vector2(0.6f, 0.7f) * size);
@@ -1477,7 +1473,7 @@ private static void DrawRotationsLoaded()
if (lastRole == role && lastRole != JobRole.None) ImGui.SameLine();
lastRole = role;
- if (IconSet.GetTexture(IconSet.GetJobIcon(jobs.Key, IconType.Framed), out var texture, 62574))
+ if (ImageLoader.GetTexture(IconSet.GetJobIcon(jobs.Key, IconType.Framed), out var texture, 62574))
ImGui.Image(texture.ImGuiHandle, Vector2.One * 30 * Scale);
ImguiTooltips.HoveredTooltip(string.Join('\n', jobs.Select(t => t.GetCustomAttribute()?.Name ?? t.Name)));
@@ -1491,7 +1487,7 @@ private static void DrawRotationsLoaded()
}
if (!string.IsNullOrEmpty(info.DonateLink)
- && IconSet.GetTexture("https://storage.ko-fi.com/cdn/brandasset/kofi_button_red.png", out var icon)
+ && ImageLoader.GetTexture("https://storage.ko-fi.com/cdn/brandasset/kofi_button_red.png", out var icon)
&& ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, new Vector2(1, (float)icon.Height / icon.Width) * MathF.Min(250, icon.Width) * Scale, info.FilePath ?? string.Empty))
{
Util.OpenLink(info.DonateLink);
@@ -1642,7 +1638,7 @@ internal static void StatusPopUp(string popupId, Status[] allStatus, ref string
var searchingKey = searching;
foreach (var status in allStatus.OrderByDescending(s => SearchableCollection.Similarity(s.Name + " " + s.RowId.ToString(), searchingKey)))
{
- if (IconSet.GetTexture(status.Icon, out var texture, notLoadId))
+ if (ImageLoader.GetTexture(status.Icon, out var texture, notLoadId))
{
if (index++ % count != 0)
{
@@ -1790,7 +1786,7 @@ private static void DrawStatusList(string name, HashSet statuses, Status[]
var count = Math.Max(1, (int)MathF.Floor(ImGui.GetColumnWidth() / (24 * Scale + ImGui.GetStyle().ItemSpacing.X)));
var index = 0;
- if (IconSet.GetTexture(16220, out var text))
+ if (ImageLoader.GetTexture(16220, out var text))
{
if (index++ % count != 0)
{
@@ -1813,7 +1809,7 @@ private static void DrawStatusList(string name, HashSet statuses, Status[]
ImGuiHelper.DrawHotKeysPopup(key, string.Empty, (UiString.ConfigWindow_List_Remove.Local(), Delete, ["Delete"]));
- if (IconSet.GetTexture(status.Icon, out var texture, notLoadId))
+ if (ImageLoader.GetTexture(status.Icon, out var texture, notLoadId))
{
if (index++ % count != 0)
{
@@ -1959,7 +1955,7 @@ private static void DrawListTerritories()
}
var icon = DataCenter.ContentFinder?.ContentType?.Value?.Icon ?? 23;
if (icon == 0) icon = 23;
- var getIcon = IconSet.GetTexture(icon, out var texture);
+ var getIcon = ImageLoader.GetTexture(icon, out var texture);
ImGuiHelper.DrawItemMiddle(() =>
{
if (getIcon)
@@ -2837,16 +2833,16 @@ private static void DrawGitHubBadge(string userName, string repository, string i
link = string.IsNullOrEmpty(link) ? $"https://GitHub.com/{userName}/{repository}" : link;
- if (IconSet.GetTexture($"https://github-readme-stats.vercel.app/api/pin/?username={userName}&repo={repository}&theme=dark", out var icon)
+ if (ImageLoader.GetTexture($"https://github-readme-stats.vercel.app/api/pin/?username={userName}&repo={repository}&theme=dark", out var icon)
&& (center ? ImGuiHelper.TextureButton(icon, wholeWidth, icon.Width, id)
: ImGuiHelper.NoPaddingNoColorImageButton(icon.ImGuiHandle, new Vector2(icon.Width, icon.Height), id)))
{
Util.OpenLink(link);
}
- var hasDate = IconSet.GetTexture($"https://img.shields.io/github/release-date/{userName}/{repository}?style=for-the-badge", out var releaseDate);
+ var hasDate = ImageLoader.GetTexture($"https://img.shields.io/github/release-date/{userName}/{repository}?style=for-the-badge", out var releaseDate);
- var hasCount = IconSet.GetTexture($"https://img.shields.io/github/downloads/{userName}/{repository}/latest/total?style=for-the-badge&label=", out var downloadCount);
+ var hasCount = ImageLoader.GetTexture($"https://img.shields.io/github/downloads/{userName}/{repository}/latest/total?style=for-the-badge&label=", out var downloadCount);
var style = ImGui.GetStyle();
var spacing = style.ItemSpacing;
@@ -2896,7 +2892,7 @@ internal static void DrawContentFinder(ContentFinderCondition? content)
{
var badge = content?.Image;
if (badge != null && badge.Value != 0
- && IconSet.GetTexture(badge.Value, out var badgeTexture))
+ && ImageLoader.GetTexture(badge.Value, out var badgeTexture))
{
var wholeWidth = ImGui.GetWindowWidth();
var size = new Vector2(badgeTexture.Width, badgeTexture.Height) * MathF.Min(1, MathF.Min(480, wholeWidth) / badgeTexture.Width);
diff --git a/RotationSolver/UI/SearchableConfigs/SearchableConfigRS.cs b/RotationSolver/UI/SearchableConfigs/SearchableConfigRS.cs
index 8e92bd9e9..ed5ec17a9 100644
--- a/RotationSolver/UI/SearchableConfigs/SearchableConfigRS.cs
+++ b/RotationSolver/UI/SearchableConfigs/SearchableConfigRS.cs
@@ -2,7 +2,6 @@
using Dalamud.Interface.Utility;
using ECommons.ExcelServices;
using RotationSolver.Data;
-using System.IO;
using XIVConfigUI;
namespace RotationSolver.UI.SearchableConfigs;
@@ -50,17 +49,10 @@ private static void DrawJobIcon(Job job)
{
ImGui.SameLine();
- if (IconSet.GetTexture(IconSet.GetJobIcon(job, IconType.Framed), out var texture))
+ if (ImageLoader.GetTexture(IconSet.GetJobIcon(job, IconType.Framed), out var texture))
{
ImGui.Image(texture.ImGuiHandle, Vector2.One * 24 * ImGuiHelpers.GlobalScale);
ImguiTooltips.HoveredTooltip(UiString.JobConfigTip.Local());
}
}
-
- public override bool GetTexture(string path, out IDalamudTextureWrap texture, bool loadingIcon = false)
- => IconSet.GetTexture(path, out texture, loadingIcon);
-
- public override bool GetTexture(uint id, out IDalamudTextureWrap texture, uint @default = 0)
- => IconSet.GetTexture(id, out texture, @default);
-
}
diff --git a/RotationSolver/UI/TimelineDrawer.cs b/RotationSolver/UI/TimelineDrawer.cs
index fdf74b179..0cbc340df 100644
--- a/RotationSolver/UI/TimelineDrawer.cs
+++ b/RotationSolver/UI/TimelineDrawer.cs
@@ -273,7 +273,7 @@ private static void DrawTimelineItem(BaseTimelineItem timeLineItem, TimelineItem
var popUpKey = $"Action Finder{timeLineItem.GetHashCode()}";
ConditionDrawer.ActionSelectorPopUp(popUpKey, _timelineActionsList, DataCenter.RightNowRotation, item => actionItem.ID = (ActionID)item.ID);
- if (actionItem.ID.GetTexture(out var icon) || IconSet.GetTexture(4, out icon))
+ if (actionItem.ID.GetTexture(out var icon) || ImageLoader.GetTexture(4, out icon))
{
ImGui.SameLine();
var cursor = ImGui.GetCursorPos();
@@ -345,7 +345,7 @@ void Down()
(UiString.ConfigWindow_Actions_MoveUp.Local(), Up, ["↑"]),
(UiString.ConfigWindow_Actions_MoveDown.Local(), Down, ["↓"]));
- if (IconSet.GetTexture(10, out var texture))
+ if (ImageLoader.GetTexture(10, out var texture))
{
if (ImGuiHelper.NoPaddingNoColorImageButton(texture.ImGuiHandle, ConditionDrawer.IconSize * Vector2.One, "Position " + moveItem.GetHashCode() + i))
{
@@ -436,7 +436,7 @@ void Copy()
(UiString.ConfigWindow_Actions_MoveDown.Local(), Down, ["↓"]),
(UiString.ConfigWindow_Actions_Copy.Local(), Copy, ["Ctrl"]));
- if (IconSet.GetTexture(30, out var texture))
+ if (ImageLoader.GetTexture(30, out var texture))
{
if (ImGuiHelper.SilenceImageButton(texture.ImGuiHandle, Vector2.One * ConditionDrawer.IconSize, false, $"Icon :{item.GetHashCode()}"))
{
@@ -916,7 +916,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
var key = "Status PopUp" + getter.GetHashCode();
var status = Svc.Data.GetExcelSheet()?.GetRow(getter.Status);
- if (IconSet.GetTexture(getter.Status == 0 ? 16220 : status?.Icon ?? 10100, out var texture, 10100))
+ if (ImageLoader.GetTexture(getter.Status == 0 ? 16220 : status?.Icon ?? 10100, out var texture, 10100))
{
if (ImGuiHelper.NoPaddingNoColorImageButton(texture.ImGuiHandle, new Vector2(24, 32) * Scale, "Status" + getter.Status.ToString()))
{
@@ -936,7 +936,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
var size = Vector2.One * 24 * Scale;
- if (IconSet.GetTexture("https://xivapi.com/cj/misc/clear_tank.png", out var overlay))
+ if (ImageLoader.GetTexture("https://xivapi.com/cj/misc/clear_tank.png", out var overlay))
{
if (ImGuiHelper.SilenceImageButton(overlay.ImGuiHandle, size,
getter.Tank, "Tank##" + getter.GetHashCode()))
@@ -947,7 +947,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
ImGui.SameLine();
- if (IconSet.GetTexture("https://xivapi.com/cj/misc/clear_healer.png", out overlay))
+ if (ImageLoader.GetTexture("https://xivapi.com/cj/misc/clear_healer.png", out overlay))
{
if (ImGuiHelper.SilenceImageButton(overlay.ImGuiHandle, size,
getter.Healer, "Healer##" + getter.GetHashCode()))
@@ -958,7 +958,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
ImGui.SameLine();
- if (IconSet.GetTexture("https://xivapi.com/cj/misc/clear_dps.png", out overlay))
+ if (ImageLoader.GetTexture("https://xivapi.com/cj/misc/clear_dps.png", out overlay))
{
if (ImGuiHelper.SilenceImageButton(overlay.ImGuiHandle, size,
getter.Melee, "Melee##" + getter.GetHashCode()))
@@ -969,7 +969,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
ImGui.SameLine();
- if (IconSet.GetTexture("https://xivapi.com/cj/misc/clear_ranged.png", out overlay))
+ if (ImageLoader.GetTexture("https://xivapi.com/cj/misc/clear_ranged.png", out overlay))
{
if (ImGuiHelper.SilenceImageButton(overlay.ImGuiHandle, size,
getter.Range, "Range##" + getter.GetHashCode()))
@@ -980,7 +980,7 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
ImGui.SameLine();
- if (IconSet.GetTexture("https://xivapi.com/cj/misc/clear_dps_magic.png", out overlay))
+ if (ImageLoader.GetTexture("https://xivapi.com/cj/misc/clear_dps_magic.png", out overlay))
{
if (ImGuiHelper.SilenceImageButton(overlay.ImGuiHandle, size,
getter.Caster, "Caster##" + getter.GetHashCode()))
diff --git a/RotationSolver/Updaters/RaidTimeUpdater.cs b/RotationSolver/Updaters/RaidTimeUpdater.cs
index cd7c5a879..8f33c9847 100644
--- a/RotationSolver/Updaters/RaidTimeUpdater.cs
+++ b/RotationSolver/Updaters/RaidTimeUpdater.cs
@@ -525,7 +525,7 @@ static async Task DownloadRaidTimeAsync(string path, RaidLangs l
windowMax = float.Parse(windowStrs.Last(), CultureInfo.InvariantCulture);
}
- result.Add(new (time, name, type, item, lang, jumpTime, windowMin, windowMax));
+ result.Add(new(time, name, type, item, lang, jumpTime, windowMin, windowMax));
}
catch (Exception ex)
{
diff --git a/XIVConfigUI b/XIVConfigUI
index a9aa5fe72..227c59e9f 160000
--- a/XIVConfigUI
+++ b/XIVConfigUI
@@ -1 +1 @@
-Subproject commit a9aa5fe728d8fbf0b76e5ec8af7bed6b60f0c49b
+Subproject commit 227c59e9f19e467c6071d54ffbf491b93dfbe411