Skip to content

Commit

Permalink
Merge pull request #4 from FFXIV-CombatReborn/api11
Browse files Browse the repository at this point in the history
Api11
  • Loading branch information
NostraThomas99 authored Nov 23, 2024
2 parents c292a20 + f70a41c commit 328fc0b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
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": 10,
"DalamudApiLevel": 11,
"LoadRequiredState": 0,
"LoadSync": false,
"CanUnloadAsync": false,
Expand Down
25 changes: 12 additions & 13 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using ECommons.Hooks;
using ECommons.Hooks.ActionEffectTypes;
using FFXIVClientStructs.FFXIV.Client.Game;
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using RotationSolver.Basic.Data;
using Action = Lumina.Excel.GeneratedSheets.Action;
using Status = Lumina.Excel.GeneratedSheets.Status;
using Action = Lumina.Excel.Sheets.Action;
using Status = Lumina.Excel.Sheets.Status;

namespace ActionTimeline.Timeline;

Expand Down Expand Up @@ -74,7 +74,7 @@ protected void Dispose(bool disposing)
private readonly Hook<OnActorControlDelegate>? _onActorControlHook = null;

private delegate void OnCastDelegate(uint sourceId, IntPtr sourceCharacter);
[Signature("40 55 56 48 81 EC ?? ?? ?? ?? 48 8B EA", DetourName = nameof(OnCast))]
[Signature("40 56 41 56 48 81 EC ?? ?? ?? ?? 48 8B F2", DetourName = nameof(OnCast))]
private readonly Hook<OnCastDelegate>? _onCastHook = null;

public static SortedSet<ushort> ShowedStatusId { get; } = [];
Expand Down Expand Up @@ -166,17 +166,17 @@ private static TimelineItemType GetActionType(uint actionId, ActionType type)

if (actionId == 3) return TimelineItemType.OGCD; //Sprint

var actionCate = (ActionCate)(action.ActionCategory.Value?.RowId ?? 0);
var actionCate = (ActionCate)(action.Value.ActionCategory.Value.RowId);

var isRealGcd = action.CooldownGroup == GCDCooldownGroup || action.AdditionalCooldownGroup == GCDCooldownGroup;
var isRealGcd = action.Value.CooldownGroup == GCDCooldownGroup || action.Value.AdditionalCooldownGroup == GCDCooldownGroup;
return actionCate == ActionCate.AutoAttack
? TimelineItemType.AutoAttack
: !isRealGcd && actionCate == ActionCate.Ability ? TimelineItemType.OGCD
: TimelineItemType.GCD;

case ActionType.Item:
var item = Svc.Data.GetExcelSheet<Item>()?.GetRow(actionId);
return item?.CastTimes > 0 ? TimelineItemType.GCD : TimelineItemType.OGCD;
return item?.CastTimeSeconds > 0 ? TimelineItemType.GCD : TimelineItemType.OGCD;
}

return TimelineItemType.GCD;
Expand All @@ -198,14 +198,14 @@ private static uint GetStatusIcon(ushort id, bool isGain, out string? name, byte
if (Plugin.Settings.HideStatusIds.Contains(id)) return 0;
var status = Svc.Data.GetExcelSheet<Status>()?.GetRow(id);
if (status == null) return 0;
name = status.Name;
name = status.Value.Name.ToString();

ShowedStatusId.Add(id);
var icon = status.Icon;
var icon = status.Value.Icon;

if (isGain)
{
return icon + (uint)Math.Max(0, status.MaxStacks - 1);
return icon + (uint)Math.Max(0, status.Value.MaxStacks - 1);
}
else
{
Expand Down Expand Up @@ -364,8 +364,7 @@ private async void AddStatusLine(TimelineItem? effectItem, ulong targetId)

foreach (var status in statusList)
{
var icon = Svc.Data.GetExcelSheet<Status>()?.GetRow(status.StatusId)?.Icon;
if (icon == null) continue;
var icon = Svc.Data.GetExcelSheet<Status>().GetRow(status.StatusId).Icon;

foreach (var item in list)
{
Expand Down Expand Up @@ -464,7 +463,7 @@ private unsafe void OnCast(uint sourceId, IntPtr ptr)

AddItem(new TimelineItem()
{
Name = action?.Name ?? string.Empty,
Name = action?.Name.ToString() ?? string.Empty,
Icon = actionId == 4 ? (ushort)118 //Mount
: action?.Icon ?? 0,
StartTime = DateTime.Now,
Expand Down
4 changes: 2 additions & 2 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using ECommons.Commands;
using ECommons.DalamudServices;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using System.Numerics;

namespace ActionTimeline.Windows
Expand Down Expand Up @@ -167,7 +167,7 @@ private void DrawGeneralSetting()
if (texture != null)
{
ImGui.Image(texture.ImGuiHandle, new Vector2(24, 30));
DrawHelper.SetTooltip(status?.Name ?? string.Empty);
DrawHelper.SetTooltip(status?.Name.ToString() ?? string.Empty);
ImGui.SameLine();
}

Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 274 files
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"CategoryTags": [
"UI"
],
"DalamudApiLevel": 10,
"DalamudApiLevel": 11,
"LoadRequiredState": 0,
"LoadSync": false,
"CanUnloadAsync": false,
Expand Down

0 comments on commit 328fc0b

Please sign in to comment.