From dff0b8aaf73954c8d91a70875ab80c9bfc485e78 Mon Sep 17 00:00:00 2001 From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com> Date: Sat, 29 Jun 2024 21:58:38 -0500 Subject: [PATCH 1/4] Update ECommons --- ECommons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ECommons b/ECommons index 79db619..34d10d7 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 79db61912cbfbb1627fc20a226ef02f8f0f7ad5c +Subproject commit 34d10d769732885b3b0a78850bbd708d67e8334b From 138af96d40f89cb484d9b03d0a674a5137113980 Mon Sep 17 00:00:00 2001 From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:31:08 -0500 Subject: [PATCH 2/4] apiX updates --- ActionTimelineEx/ActionTimelineEx.json | 2 +- ActionTimelineEx/Helpers/DrawHelper.cs | 14 ++------------ ActionTimelineEx/Plugin.cs | 3 +-- ActionTimelineEx/Timeline/StatusLineItem.cs | 1 + ActionTimelineEx/Timeline/TimelineItem.cs | 1 + ActionTimelineEx/Timeline/TimelineManager.cs | 18 +++++++++--------- 6 files changed, 15 insertions(+), 24 deletions(-) diff --git a/ActionTimelineEx/ActionTimelineEx.json b/ActionTimelineEx/ActionTimelineEx.json index a54394e..30c3af9 100644 --- a/ActionTimelineEx/ActionTimelineEx.json +++ b/ActionTimelineEx/ActionTimelineEx.json @@ -12,7 +12,7 @@ "CategoryTags": [ "UI" ], - "DalamudApiLevel": 9, + "DalamudApiLevel": 10, "LoadRequiredState": 0, "LoadSync": false, "CanUnloadAsync": false, diff --git a/ActionTimelineEx/Helpers/DrawHelper.cs b/ActionTimelineEx/Helpers/DrawHelper.cs index 2088b4c..9290f2c 100644 --- a/ActionTimelineEx/Helpers/DrawHelper.cs +++ b/ActionTimelineEx/Helpers/DrawHelper.cs @@ -4,6 +4,7 @@ using ImGuiNET; using Lumina.Data.Files; using System.Numerics; +using Dalamud.Interface.Textures.TextureWraps; namespace ActionTimeline.Helpers; @@ -15,18 +16,7 @@ internal static class DrawHelper private static IDalamudTextureWrap? _roundTex; public static void Init() { - var tex = Svc.Data.GetFile("ui/uld/icona_frame_hr1.tex"); - if (tex == null) return; - byte[] imageData = tex.ImageData; - byte[] array = new byte[imageData.Length]; - - for (int i = 0; i < imageData.Length; i += 4) - { - array[i] = array[i + 1] = array[i + 2] = byte.MaxValue; - array[i + 3] = imageData[i + 3]; - } - - _roundTex = Svc.PluginInterface.UiBuilder.LoadImageRaw(array, tex!.Header.Width, tex!.Header.Height, 4); + ThreadLoadImageHandler.TryGetTextureWrap("ui/uld/icona_frame_hr1.tex", out _roundTex); } public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, float size, uint lightCol) diff --git a/ActionTimelineEx/Plugin.cs b/ActionTimelineEx/Plugin.cs index d5cde6b..e2db26f 100644 --- a/ActionTimelineEx/Plugin.cs +++ b/ActionTimelineEx/Plugin.cs @@ -66,7 +66,7 @@ public class Plugin : IDalamudPlugin private static WindowSystem _windowSystem = null!; private static SettingsWindow _settingsWindow = null!; - public Plugin(DalamudPluginInterface pluginInterface) + public Plugin(IDalamudPluginInterface pluginInterface) { ECommonsMain.Init(pluginInterface, this); @@ -192,6 +192,5 @@ protected virtual void Dispose(bool disposing) Svc.PluginInterface.UiBuilder.Draw -= Draw; Svc.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfigUi; - Svc.PluginInterface.UiBuilder.RebuildFonts(); } } diff --git a/ActionTimelineEx/Timeline/StatusLineItem.cs b/ActionTimelineEx/Timeline/StatusLineItem.cs index f916d22..15880d2 100644 --- a/ActionTimelineEx/Timeline/StatusLineItem.cs +++ b/ActionTimelineEx/Timeline/StatusLineItem.cs @@ -4,6 +4,7 @@ using ImGuiNET; using ImGuiScene; using System.Numerics; +using Dalamud.Interface.Textures.TextureWraps; namespace ActionTimelineEx.Timeline; diff --git a/ActionTimelineEx/Timeline/TimelineItem.cs b/ActionTimelineEx/Timeline/TimelineItem.cs index 09b839d..0244eb2 100644 --- a/ActionTimelineEx/Timeline/TimelineItem.cs +++ b/ActionTimelineEx/Timeline/TimelineItem.cs @@ -4,6 +4,7 @@ using Dalamud.Interface.Internal; using ImGuiNET; using System.Numerics; +using Dalamud.Interface.Textures.TextureWraps; namespace ActionTimelineEx.Timeline; diff --git a/ActionTimelineEx/Timeline/TimelineManager.cs b/ActionTimelineEx/Timeline/TimelineManager.cs index 20424e3..7f702e0 100644 --- a/ActionTimelineEx/Timeline/TimelineManager.cs +++ b/ActionTimelineEx/Timeline/TimelineManager.cs @@ -225,7 +225,7 @@ private void ActionFromSelf(ActionEffectSet set) #if DEBUG //Svc.Chat.Print($"Id: {set.Header.ActionID}; {set.Header.ActionType}; Source: {set.Source.ObjectId}"); #endif - if (set.Source.ObjectId != Player.Object.ObjectId || !Plugin.Settings.Record) return; + if (set.Source.GameObjectId != Player.Object.GameObjectId || !Plugin.Settings.Record) return; DamageType damage = DamageType.None; SortedSet<(uint, string?)> statusGain = [], statusLose = []; @@ -234,7 +234,7 @@ private void ActionFromSelf(ActionEffectSet set) { var effect = set.TargetEffects[i]; var recordTarget = Plugin.Settings.RecordTargetStatus - || effect.TargetID == Player.Object.ObjectId; + || effect.TargetID == Player.Object.GameObjectId; if (effect[0].type is ActionEffectType.Damage or ActionEffectType.Heal) { @@ -354,10 +354,10 @@ private async void AddStatusLine(TimelineItem? effectItem, ulong targetId) } } - var statusList = Player.Object.StatusList.Where(s => s.SourceId == Player.Object.ObjectId); - if (Svc.Objects.SearchById(targetId) is BattleChara b) + var statusList = Player.Object.StatusList.Where(s => s.SourceId == Player.Object.GameObjectId); + if (Svc.Objects.SearchById(targetId) is IBattleChara b) { - statusList = statusList.Union(b.StatusList.Where(s => s.SourceId == Player.Object.ObjectId)); + statusList = statusList.Union(b.StatusList.Where(s => s.SourceId == Player.Object.GameObjectId)); } await Task.Delay(950); @@ -390,9 +390,9 @@ private async void OnActorControl(uint entityId, ActorControlCategory type, uint try { - if (entityId != Player.Object?.ObjectId) return; + if (entityId != Player.Object?.GameObjectId) return; - var record = Plugin.Settings.Record && sourceId == Player.Object?.ObjectId; + var record = Plugin.Settings.Record && sourceId == Player.Object?.GameObjectId; switch (type) { @@ -401,7 +401,7 @@ private async void OnActorControl(uint entityId, ActorControlCategory type, uint break; case ActorControlCategory.LoseEffect when record: - var stack = Player.Object?.StatusList.FirstOrDefault(s => s.StatusId == buffID && s.SourceId == Player.Object.ObjectId)?.StackCount ?? 0; + var stack = Player.Object?.StatusList.FirstOrDefault(s => s.StatusId == buffID && s.SourceId == Player.Object.GameObjectId)?.StackCount ?? 0; var icon = GetStatusIcon((ushort)buffID, false, out var name, ++stack); if (icon == 0) break; @@ -456,7 +456,7 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr) try { - if (sourceId != Player.Object?.ObjectId || !Plugin.Settings.Record) return; + if (sourceId != Player.Object?.GameObjectId || !Plugin.Settings.Record) return; var actionId = *(ushort*)ptr; From 52d1042aa6332baeb1c2e872f3c80cc887886709 Mon Sep 17 00:00:00 2001 From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com> Date: Sun, 30 Jun 2024 09:34:45 -0500 Subject: [PATCH 3/4] Update DalamudApiLevel and remove AssemblyVersion The AssemblyVersion information was removed from manifest.json as it was outdated and unnecessary. Also, the DalamudApiLevel has been updated from 9 to 10 to match with the latest API level changes. --- ECommons | 2 +- manifest.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ECommons b/ECommons index 34d10d7..9de6521 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 34d10d769732885b3b0a78850bbd708d67e8334b +Subproject commit 9de65215ec8aab18c350a3d0f75a9fdeca49ebdb diff --git a/manifest.json b/manifest.json index e192f16..57833ab 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,6 @@ "Author": "The Combat Reborn Team", "Name": "ActionTimeline Reborn", "InternalName": "ActionTimelineEx", - "AssemblyVersion": "1.3.6.0", "Description": "Configurable timeline display of all the actions you use.", "ApplicableVersion": "any", "Tags": [ @@ -11,7 +10,7 @@ "CategoryTags": [ "UI" ], - "DalamudApiLevel": 9, + "DalamudApiLevel": 10, "LoadRequiredState": 0, "LoadSync": false, "CanUnloadAsync": false, From 5fdd4315b3afc1fa53b61e1c9e154eba9610eb36 Mon Sep 17 00:00:00 2001 From: NostraThomas99 <34015422+NostraThomas99@users.noreply.github.com> Date: Sun, 30 Jun 2024 09:37:35 -0500 Subject: [PATCH 4/4] Update DalamudPackager --- ActionTimelineEx/ActionTimelineEx.csproj | 2 +- ActionTimelineEx/packages.lock.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ActionTimelineEx/ActionTimelineEx.csproj b/ActionTimelineEx/ActionTimelineEx.csproj index 3cde0f7..bf741c5 100644 --- a/ActionTimelineEx/ActionTimelineEx.csproj +++ b/ActionTimelineEx/ActionTimelineEx.csproj @@ -13,7 +13,7 @@ - + diff --git a/ActionTimelineEx/packages.lock.json b/ActionTimelineEx/packages.lock.json index ece58ee..ada8e43 100644 --- a/ActionTimelineEx/packages.lock.json +++ b/ActionTimelineEx/packages.lock.json @@ -4,9 +4,9 @@ "net8.0-windows7.0": { "DalamudPackager": { "type": "Direct", - "requested": "[2.1.12, )", - "resolved": "2.1.12", - "contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg==" + "requested": "[2.1.13, )", + "resolved": "2.1.13", + "contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ==" }, "ecommons": { "type": "Project"