Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: little patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Sep 30, 2023
1 parent 83867a0 commit 6218cf2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
15 changes: 7 additions & 8 deletions RotationSolver.Basic/Data/IconSet.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using ECommons.DalamudServices;
using Dalamud.Interface.Internal;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.ImGuiMethods;
using ImGuiScene;
using Lumina.Data.Parsing;
using Lumina.Excel.GeneratedSheets;
using Svg;
using System.Collections.Generic;
using System.Drawing.Imaging;

namespace RotationSolver.Basic.Data;
Expand Down Expand Up @@ -105,7 +104,7 @@ private static byte[] SvgToPng(byte[] data)
/// <param name="text"></param>
/// <param name="texture"></param>
/// <returns></returns>
public static bool GetTexture(this ITexture text, out TextureWrap texture) => GetTexture(text?.IconID ?? 0, out texture);
public static bool GetTexture(this ITexture text, out IDalamudTextureWrap texture) => GetTexture(text?.IconID ?? 0, out texture);

/// <summary>
/// Get Texture from id.
Expand All @@ -125,7 +124,7 @@ public static TextureWrap GetTexture(uint id)
/// <param name="texture"></param>
/// <param name="default"></param>
/// <returns></returns>
public static bool GetTexture(uint id, out TextureWrap texture, uint @default = 0)
public static bool GetTexture(uint id, out IDalamudTextureWrap texture, uint @default = 0)
=> ThreadLoadImageHandler.TryGetIconTextureWrap(id, false, out texture)
|| ThreadLoadImageHandler.TryGetIconTextureWrap(@default, false, out texture)
|| ThreadLoadImageHandler.TryGetIconTextureWrap(0, false, out texture);
Expand All @@ -136,7 +135,7 @@ public static bool GetTexture(uint id, out TextureWrap texture, uint @default =
/// <param name="path"></param>
/// <param name="texture"></param>
/// <returns></returns>
public static bool GetTexture(string path, out TextureWrap texture)
public static bool GetTexture(string path, out IDalamudTextureWrap texture)
=> ThreadLoadImageHandler.TryGetTextureWrap(path, out texture)
|| (path.StartsWith("http:", StringComparison.OrdinalIgnoreCase) || path.StartsWith("https:", StringComparison.OrdinalIgnoreCase))
&& GetTexture("ui/uld/image2.tex", out texture); // loading pics.
Expand All @@ -150,7 +149,7 @@ public static bool GetTexture(string path, out TextureWrap texture)
/// <param name="texture"></param>
/// <param name="isAdjust"></param>
/// <returns></returns>
public static bool GetTexture(this IAction action, out TextureWrap texture, bool isAdjust = true)
public static bool GetTexture(this IAction action, out IDalamudTextureWrap texture, bool isAdjust = true)
{
uint iconId = 0;
if (action != null)
Expand All @@ -176,7 +175,7 @@ public static bool GetTexture(this IAction action, out TextureWrap texture, bool
/// <param name="texture"></param>
/// <param name="isAction"></param>
/// <returns></returns>
public static bool GetTexture(this ActionID actionID, out TextureWrap texture, bool isAction = true)
public static bool GetTexture(this ActionID actionID, out IDalamudTextureWrap texture, bool isAction = true)
{
var id = (uint)actionID;

Expand Down
6 changes: 4 additions & 2 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@
"ConfigWindow_Basic_ClickingDuration": "The clicking duration, RS will try to click at this moment.",
"ConfigWindow_Basic_WeaponDelay": "This is the clipping time.\nGCD is over. However, RS forgets to click the next action.",
"ConfigWindow_About_ClickingCount": "Rotation Solver helped you by clicking actions {0:N0} times.",
"ConfigWindow_About_ClickingTooMuch": "Well, you must be a lazy player!",
"ConfigWindow_Auto_AutoHealTimeToKill": "Stop healing when time to kill is lower then...",
"ConfigWindow_UI_ShowHostiles": "Show the hostile target icon",
"ConfigWindow_UI_HostileIconHeight": "Hostile Icon height from position",
Expand All @@ -526,5 +525,8 @@
"ConfigWindow_Auto_UseResourcesAction": "Use actions that use resources",
"ConfigWindow_Auto_HealthForAutoDefense": "HP Ratio about defense single of Tanks",
"ConfigWindow_Basic_SayHelloToUsers": "Say hello to the users of Rotation Solver.",
"ConfigWindow_Basic_SayHelloToUsersDesc": "It can only be disabled for users, not authors and contributors.\nIf you want to be greeted by other users, please DM ArchiTed in Discord Server with your Hash!"
"ConfigWindow_Basic_SayHelloToUsersDesc": "It can only be disabled for users, not authors and contributors.\nIf you want to be greeted by other users, please DM ArchiTed in Discord Server with your Hash!",
"ConfigWindow_Basic_JustSayHelloOnce": "Just say hello once to the same user.",
"ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!"
}
4 changes: 3 additions & 1 deletion RotationSolver/UI/ImGuiHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Dalamud.Game.ClientState.Keys;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Utility;
using ECommons.DalamudServices;
using ECommons.ImGuiMethods;
using ImGuiScene;
Expand Down Expand Up @@ -206,7 +208,7 @@ internal static bool NoPaddingImageButton(IntPtr handle, Vector2 size, string id
return result;
}

internal static bool TextureButton(TextureWrap texture, float wholeWidth, float maxWidth, string id = "")
internal static bool TextureButton(IDalamudTextureWrap texture, float wholeWidth, float maxWidth, string id = "")
{
if (texture == null) return false;

Expand Down
1 change: 0 additions & 1 deletion RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using ECommons.GameFunctions;
using ECommons.GameHelpers;
using RotationSolver.Basic.Configuration;
using RotationSolver.Updaters;
Expand Down
7 changes: 4 additions & 3 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Dalamud.Interface.Colors;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Logging;
using Dalamud.Utility;
Expand All @@ -10,7 +12,6 @@
using ExCSS;
using FFXIVClientStructs.FFXIV.Client.Game.Fate;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using ImGuiScene;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Basic.Configuration;
using RotationSolver.Data;
Expand Down Expand Up @@ -235,8 +236,8 @@ private void DrawSideBar()
}

private const int FRAME_COUNT = 180;
private static SortedList<string, TextureWrap> _textureWrapList = new SortedList<string, TextureWrap>(FRAME_COUNT);
private static bool GetLocalImage(string name, out TextureWrap texture)
private static SortedList<string, IDalamudTextureWrap> _textureWrapList = new SortedList<string, IDalamudTextureWrap>(FRAME_COUNT);
private static bool GetLocalImage(string name, out IDalamudTextureWrap texture)
{
var url = $"RotationSolver.Logos.{name}.png";
if (_textureWrapList.TryGetValue(name, out texture)) return texture != null;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Logging;
using ECommons.Automation;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.UI;
Expand Down Expand Up @@ -172,7 +173,7 @@ private static async void SayHelloToUsers()
.Where(p => DownloadHelper.ContributorsHash.Contains(p.Item2))
.Select(p => new ContributorChatEntity(p.player)), _comparer);

if (Service.Config.GetValue(Basic.Configuration.PluginConfigBool.SayHelloToUsers))
if (Service.Config.GetValue(PluginConfigBool.SayHelloToUsers))
{
entities = entities.Union(players
.Where(p => DownloadHelper.UsersHash.Contains(p.Item2))
Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 6218cf2

Please sign in to comment.