Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api11 #4

Merged
merged 4 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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