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

Commit

Permalink
fix: api 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 2, 2023
1 parent d4321c4 commit fcb8a35
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
12 changes: 6 additions & 6 deletions ActionTimelineEx/Helpers/DrawHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using Dalamud.Interface.Internal;
using ECommons.DalamudServices;
using ECommons.ImGuiMethods;
using ImGuiNET;
using ImGuiScene;
Expand All @@ -12,7 +13,7 @@ internal static class DrawHelper
private static readonly Vector2 _uv1 = new Vector2(96 * 5 / 852f, 0),
_uv2 = new Vector2((96 * 5 + 144) / 852f, 0.5f);

private static TextureWrap? _roundTex;
private static IDalamudTextureWrap? _roundTex;
public static void Init()
{
var tex = Svc.Data.GetFile<TexFile>("ui/uld/icona_frame_hr1.tex");
Expand Down Expand Up @@ -42,7 +43,7 @@ public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, flo

public static void DrawActionIcon(this ImDrawListPtr drawList, uint iconId, bool isHq, Vector2 position, float size)
{
TextureWrap? texture = GetTextureFromIconId(iconId, isHq);
IDalamudTextureWrap? texture = GetTextureFromIconId(iconId, isHq);
if (texture == null) return;

var pixPerUnit = size / 82;
Expand All @@ -64,7 +65,7 @@ public static Vector4 ChangeAlpha(this Vector4 color, float alpha)
return color;
}

public static TextureWrap? GetTextureFromIconId(uint iconId, bool highQuality = false)
public static IDalamudTextureWrap? GetTextureFromIconId(uint iconId, bool highQuality = false)
=> ThreadLoadImageHandler.TryGetIconTextureWrap(iconId, highQuality, out var texture) ? texture
: ThreadLoadImageHandler.TryGetIconTextureWrap(0, highQuality, out texture) ? texture : null;

Expand All @@ -90,8 +91,7 @@ private static void CalculateColor()
{
while(calculating.TryDequeue(out var icon))
{
var tex = Svc.Data.GetIcon(icon, false);

var tex = Svc.Data.GetFile<TexFile>($"ui/icon/{icon/1000:D3}000/{icon:D6}.tex");
if(tex == null)
{
textureColorCache[icon] = uint.MaxValue;
Expand Down
3 changes: 2 additions & 1 deletion ActionTimelineEx/Timeline/StatusLineItem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ActionTimeline.Helpers;
using ActionTimelineEx.Configurations;
using Dalamud.Interface.Internal;
using ImGuiNET;
using ImGuiScene;
using System.Numerics;
Expand Down Expand Up @@ -35,7 +36,7 @@ public void DrawItemWithCenter(Vector2 centerPos, Vector2 windowPos, DrawingSett
var flag = ImDrawFlags.RoundCornersAll;
var rounding = setting.GCDRound;

TextureWrap? texture = DrawHelper.GetTextureFromIconId(Icon);
IDalamudTextureWrap? texture = DrawHelper.GetTextureFromIconId(Icon);
if (texture == null) return;

var col = DrawHelper.GetTextureAverageColor(Icon);
Expand Down
7 changes: 4 additions & 3 deletions ActionTimelineEx/Timeline/TimelineItem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ActionTimeline.Helpers;
using ActionTimelineEx.Configurations;
using Dalamud.Interface;
using Dalamud.Interface.Internal;
using ImGuiNET;
using ImGuiScene;
using RotationSolver.Basic.Data;
Expand Down Expand Up @@ -72,12 +73,12 @@ public void DrawItemWithCenter(Vector2 centerPos, TimelineLayer icon, DrawingSet
}
}

private static (TextureWrap texture, string? name)[] GetTextures(HashSet<(uint icon, string? name)> iconIds)
private static (IDalamudTextureWrap texture, string? name)[] GetTextures(HashSet<(uint icon, string? name)> iconIds)
{
var result = new List<(TextureWrap texture, string? name)>(iconIds.Count);
var result = new List<(IDalamudTextureWrap texture, string? name)>(iconIds.Count);
foreach (var item in iconIds)
{
TextureWrap? texture = DrawHelper.GetTextureFromIconId(item.icon);
IDalamudTextureWrap? texture = DrawHelper.GetTextureFromIconId(item.icon);
if (texture == null) continue;
result.Add((texture, item.name));
}
Expand Down
8 changes: 4 additions & 4 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public TimelineManager()
{
try
{
SignatureHelper.Initialise(this);
Svc.Hook.InitializeFromAttributes(this);
_onActorControlHook?.Enable();
_onCastHook?.Enable();

ActionEffect.ActionEffectEvent += ActionFromSelf;
}
catch (Exception e)
{
PluginLog.Error("Error initiating hooks: " + e.Message);
Svc.Log.Error("Error initiating hooks: " + e.Message);
}
}

Expand Down Expand Up @@ -447,7 +447,7 @@ private async void OnActorControl(uint entityId, ActorControlCategory type, uint

catch (Exception ex)
{
PluginLog.Warning(ex, "Something wrong with OnActorControl!");
Svc.Log.Warning(ex, "Something wrong with OnActorControl!");
}
}

Expand Down Expand Up @@ -477,7 +477,7 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr)
}
catch(Exception ex)
{
PluginLog.Warning(ex, "Something wrong with OnCast1");
Svc.Log.Warning(ex, "Something wrong with OnCast1");
}
}
}
1 change: 1 addition & 0 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using ActionTimelineEx.Configurations;
using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using ECommons.Commands;
Expand Down
1 change: 1 addition & 0 deletions ActionTimelineEx/Windows/TimelineWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using ActionTimelineEx.Configurations;
using ActionTimelineEx.Timeline;
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using ImGuiNET;
using System.Numerics;

Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 33 files
+1 −1 ECommons/Automation/MacroManager.cs
+4 −1 ECommons/Automation/TaskManager.cs
+3 −1 ECommons/Automation/WindowsKeypress.cs
+1 −1 ECommons/ChatMethods/ChatPrinter.cs
+22 −0 ECommons/DalamudServices/Legacy/LegacyHelpers.cs
+16 −0 ECommons/DalamudServices/Legacy/SignatureHelper.cs
+0 −160 ECommons/DalamudServices/ServicesInternal.cs
+32 −107 ECommons/DalamudServices/Svc.cs
+6 −2 ECommons/ECommons.csproj
+2 −3 ECommons/Events/ProperOnLogin.cs
+1 −0 ECommons/GameFunctions/ObjectFunctions.cs
+26 −7 ECommons/GenericHelpers.cs
+3 −3 ECommons/Hooks/ActionEffect.cs
+2 −2 ECommons/Hooks/DirectorUpdate.cs
+1 −1 ECommons/Hooks/MapEffect.cs
+1 −1 ECommons/Hooks/SendAction.cs
+18 −6 ECommons/ImGuiMethods/ImGuiEx.cs
+3 −2 ECommons/ImGuiMethods/ImageLoadingResult.cs
+1 −0 ECommons/ImGuiMethods/KoFiButton.cs
+1 −0 ECommons/ImGuiMethods/MiddleOverlayWindow.cs
+1 −0 ECommons/ImGuiMethods/PopupWindow.cs
+8 −6 ECommons/ImGuiMethods/ThreadLoadImageHandler.cs
+3 −2 ECommons/Loader/MicroServices.cs
+2 −1 ECommons/Loader/PluginLoader.cs
+6 −6 ECommons/Logging/DuoLog.cs
+6 −6 ECommons/Logging/PluginLog.cs
+1 −1 ECommons/ObjectLifeTracker/ObjectLife.cs
+3 −2 ECommons/PartyFunctions/UniversalParty.cs
+9 −16 ECommons/Reflection/DalamudReflector.cs
+11 −1 ECommons/Reflection/ReflectionHelper.cs
+112 −0 ECommons/UIHelpers/AtkReader.cs
+24 −0 ECommons/UIHelpers/Implementations/ReaderRetainerList.cs
+21 −0 ECommons/UIHelpers/Implementations/ReaderSelectString.cs

0 comments on commit fcb8a35

Please sign in to comment.