Skip to content

Commit

Permalink
Merge pull request #3 from FFXIV-CombatReborn/dawntrail
Browse files Browse the repository at this point in the history
Dawntrail
  • Loading branch information
NostraThomas99 authored Jun 30, 2024
2 parents 4902f89 + 5fdd431 commit b7296e7
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ActionTimelineEx/ActionTimelineEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<ProjectReference Include="..\ECommons\ECommons\ECommons.csproj" />

<Reference Include="Dalamud">
Expand Down
2 changes: 1 addition & 1 deletion ActionTimelineEx/ActionTimelineEx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"CategoryTags": [
"UI"
],
"DalamudApiLevel": 9,
"DalamudApiLevel": 10,
"LoadRequiredState": 0,
"LoadSync": false,
"CanUnloadAsync": false,
Expand Down
14 changes: 2 additions & 12 deletions ActionTimelineEx/Helpers/DrawHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using ImGuiNET;
using Lumina.Data.Files;
using System.Numerics;
using Dalamud.Interface.Textures.TextureWraps;

namespace ActionTimeline.Helpers;

Expand All @@ -15,18 +16,7 @@ internal static class DrawHelper
private static IDalamudTextureWrap? _roundTex;
public static void Init()
{
var tex = Svc.Data.GetFile<TexFile>("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)
Expand Down
3 changes: 1 addition & 2 deletions ActionTimelineEx/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -192,6 +192,5 @@ protected virtual void Dispose(bool disposing)

Svc.PluginInterface.UiBuilder.Draw -= Draw;
Svc.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfigUi;
Svc.PluginInterface.UiBuilder.RebuildFonts();
}
}
1 change: 1 addition & 0 deletions ActionTimelineEx/Timeline/StatusLineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using ImGuiNET;
using ImGuiScene;
using System.Numerics;
using Dalamud.Interface.Textures.TextureWraps;

namespace ActionTimelineEx.Timeline;

Expand Down
1 change: 1 addition & 0 deletions ActionTimelineEx/Timeline/TimelineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Dalamud.Interface.Internal;
using ImGuiNET;
using System.Numerics;
using Dalamud.Interface.Textures.TextureWraps;

namespace ActionTimelineEx.Timeline;

Expand Down
18 changes: 9 additions & 9 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions ActionTimelineEx/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 125 files
3 changes: 1 addition & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -11,7 +10,7 @@
"CategoryTags": [
"UI"
],
"DalamudApiLevel": 9,
"DalamudApiLevel": 10,
"LoadRequiredState": 0,
"LoadSync": false,
"CanUnloadAsync": false,
Expand Down

0 comments on commit b7296e7

Please sign in to comment.