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

Commit

Permalink
fix: api 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 1, 2024
1 parent 62461d2 commit e858b08
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions ActionTimelineEx/Helpers/DrawHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures.TextureWraps;
using ECommons.DalamudServices;
using ECommons.ImGuiMethods;
using ImGuiNET;
Expand Down Expand Up @@ -26,7 +26,7 @@ public static void Init()
array[i + 3] = imageData[i + 3];
}

_roundTex = Svc.PluginInterface.UiBuilder.LoadImageRaw(array, tex!.Header.Width, tex!.Header.Height, 4);
_roundTex = Svc.Texture.CreateFromRaw(new Dalamud.Interface.Textures.RawImageSpecification(tex!.Header.Width, tex!.Header.Height, 4), array);
}

public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, float size, uint lightCol)
Expand Down
14 changes: 5 additions & 9 deletions ActionTimelineEx/Localization/Localization.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ActionTimelineEx.DescriptionAboutCommand": "Opens the ActionTimeline configuration window.",
"ActionTimelineEx.DescriptionAboutCommand": "Opens the ActionTimelineEx configuration window.",
"ActionTimeline.SettingsName.Record": "Record Data",
"ActionTimeline.SettingsName.ShowTimelineOnlyInDuty": "Show Only In Duty",
"ActionTimeline.SettingsName.ShowTimelineOnlyInCombat": "Show Only In Combat",
Expand All @@ -8,6 +8,7 @@
"ActionTimeline.SettingsName.SayClipping": "Say Clipping Time",
"ActionTimeline.SettingsName.ClippintTime": "Clipping Range",
"ActionTimeline.SettingsName.RecordTargetStatus": "Record Target Status",
"ActionTimeline.SettingsName.ShowDonate": "Show the donate link.",
"ActionTimelineEx.Configurations.DrawingSettingsName.Name": "The timeline Name",
"ActionTimelineEx.Configurations.DrawingSettingsName.Enable": "Enable",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsRotation": "Is Rotation",
Expand Down Expand Up @@ -81,6 +82,8 @@
"ActionTimelineEx.Configurations.UiString.Wait": "Please wait for a second.",
"ActionTimelineEx.Configurations.UiString.Confirm": "Are you sure to remove this timeline?",
"ActionTimelineEx.Configurations.UiString.Remove": "Click to remove this timeline.",
"ActionTimelineEx.Configurations.UiString.AddOne": "Add One Timeline",
"ActionTimelineEx.Configurations.UiString.RemoveDesc": "Remove this Item:",
"XIVConfigUI.LocalString.Search_Result": "Search Result",
"XIVConfigUI.LocalString.Searching": "Search... ",
"XIVConfigUI.LocalString.Search": "Search",
Expand All @@ -94,12 +97,5 @@
"XIVConfigUI.Attributes.ConfigUnitType.Degree": "Angle Unit, in degrees.",
"XIVConfigUI.Attributes.ConfigUnitType.Yalms": "Distance Unit, in yalms.",
"XIVConfigUI.Attributes.ConfigUnitType.Percent": "Ratio Unit, as percentage.",
"XIVConfigUI.Attributes.ConfigUnitType.Pixels": "Display Unit, in pixels.",
"ActionTimelineEx.Punchline": "Show your actions in real-time.",
"ActionTimeline.Windows.SettingsWindow+TimelineItem": "ActionTimeline.Windows.SettingsWindow+TimelineItem",
"ActionTimelineEx.Description": "Configurable timeline display of all the actions you use.",
"ActionTimelineEx.Configurations.UiString.AddOne": "Add One Timeline",
"ActionTimelineEx.Configurations.UiString.RemoveDesc": "Remove this Item:",
"ActionTimeline.Windows.SettingsWindow+AddOne": "AddOne",
"ActionTimeline.Windows.SettingsWindow+ChangeLog": "ChangeLog"
"XIVConfigUI.Attributes.ConfigUnitType.Pixels": "Display Unit, in pixels."
}
3 changes: 1 addition & 2 deletions ActionTimelineEx/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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);
XIVConfigUIMain.Init(pluginInterface, "/atle", "Opens the ActionTimelineEx configuration window.", PluginCommand, typeof(Settings), typeof(DrawingSettings), typeof(GroupItem), typeof(UiString));
Expand Down Expand Up @@ -101,7 +101,6 @@ public void Dispose()
Svc.PluginInterface.UiBuilder.Draw -= Draw;
Svc.PluginInterface.UiBuilder.OpenConfigUi -= OpenConfigUi;
Svc.PluginInterface.UiBuilder.OpenMainUi -= OpenConfigUi;
Svc.PluginInterface.UiBuilder.RebuildFonts();
GC.SuppressFinalize(this);
}

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

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

Expand Down
20 changes: 10 additions & 10 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ private void ActionFromSelf(ActionEffectSet set)
if (!Player.Available) return;

#if DEBUG
//Svc.Chat.Print($"Id: {set.Header.ActionID}; {set.Header.ActionType}; Source: {set.Source.ObjectId}");
//Svc.Chat.Print($"Id: {set.Header.ActionID}; {set.Header.ActionType}; Source: {set.Source.EntityId}");
#endif
if (set.Source.ObjectId != Player.Object.ObjectId || !Plugin.Settings.Record) return;
if (set.Source.EntityId != Player.Object.EntityId || !Plugin.Settings.Record) return;

DamageType damage = DamageType.None;
SortedSet<(uint, string?)> statusGain = [], statusLose = [];
Expand All @@ -219,7 +219,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.EntityId;

if (effect[0].type is ActionEffectType.Damage or ActionEffectType.Heal)
{
Expand Down Expand Up @@ -339,10 +339,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.EntityId);
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.EntityId));
}

await Task.Delay(950);
Expand Down Expand Up @@ -375,9 +375,9 @@ private async void OnActorControl(uint entityId, ActorControlCategory type, uint

try
{
if (entityId != Player.Object?.ObjectId) return;
if (entityId != Player.Object?.EntityId) return;

var record = Plugin.Settings.Record && sourceId == Player.Object?.ObjectId;
var record = Plugin.Settings.Record && sourceId == Player.Object?.EntityId;

switch (type)
{
Expand All @@ -386,7 +386,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.EntityId)?.StackCount ?? 0;

var icon = GetStatusIcon((ushort)buffID, false, out var name, ++stack);
if (icon == 0) break;
Expand Down Expand Up @@ -441,7 +441,7 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr)

try
{
if (sourceId != Player.Object?.ObjectId || !Plugin.Settings.Record) return;
if (sourceId != Player.Object?.EntityId || !Plugin.Settings.Record) return;

var actionId = *(ushort*)ptr;

Expand Down
1 change: 1 addition & 0 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Dalamud.Interface.Colors;
using Dalamud.Interface.GameFonts;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Interface.Utility;
using ECommons.Commands;
using ECommons.DalamudServices;
Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 126 files
2 changes: 1 addition & 1 deletion XIVConfigUI

0 comments on commit e858b08

Please sign in to comment.