From af39add38e3f93761f0774fd488245613af0c331 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 18 Sep 2023 09:18:01 +0200 Subject: [PATCH] [v9] Update ClientStructs and fix build (#1398) * Update ClientStructs * Use IFramework in AddonLifecycle * Fix for ClientStructs breaking changes --- Dalamud/Game/AddonLifecycle/AddonLifecycle.cs | 4 ++-- Dalamud/Interface/Internal/UiDebug.cs | 10 +++++----- lib/FFXIVClientStructs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dalamud/Game/AddonLifecycle/AddonLifecycle.cs b/Dalamud/Game/AddonLifecycle/AddonLifecycle.cs index 5fc1c7d2b..5a1070dfb 100644 --- a/Dalamud/Game/AddonLifecycle/AddonLifecycle.cs +++ b/Dalamud/Game/AddonLifecycle/AddonLifecycle.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -97,7 +97,7 @@ internal unsafe class AddonLifecycle : IDisposable, IServiceType } // Used to prevent concurrency issues if plugins try to register during iteration of listeners. - private void OnFrameworkUpdate(Framework unused) + private void OnFrameworkUpdate(IFramework unused) { if (this.newEventListeners.Any()) { diff --git a/Dalamud/Interface/Internal/UiDebug.cs b/Dalamud/Interface/Internal/UiDebug.cs index b1f27828c..524759f4a 100644 --- a/Dalamud/Interface/Internal/UiDebug.cs +++ b/Dalamud/Interface/Internal/UiDebug.cs @@ -1,5 +1,6 @@ using System; using System.Numerics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Dalamud.Game; @@ -416,7 +417,7 @@ internal unsafe class UiDebug $"MultiplyRGB: {node->MultiplyRed} {node->MultiplyGreen} {node->MultiplyBlue}"); } - private bool DrawUnitListHeader(int index, uint count, ulong ptr, bool highlight) + private bool DrawUnitListHeader(int index, ushort count, ulong ptr, bool highlight) { ImGui.PushStyleColor(ImGuiCol.Text, highlight ? 0xFFAAAA00 : 0xFFFFFFFF); if (!string.IsNullOrEmpty(this.searchInput) && !this.doingSearch) @@ -455,8 +456,6 @@ internal unsafe class UiDebug this.selectedInList[i] = false; var unitManager = &unitManagers[i]; - var unitBaseArray = &unitManager->AtkUnitEntries; - var headerOpen = true; if (!searching) @@ -468,7 +467,7 @@ internal unsafe class UiDebug for (var j = 0; j < unitManager->Count && headerOpen; j++) { - var unitBase = unitBaseArray[j]; + var unitBase = *(AtkUnitBase**)Unsafe.AsPointer(ref unitManager->EntriesSpan[j]); if (this.selectedUnitBase != null && unitBase == this.selectedUnitBase) { this.selectedInList[i] = true; @@ -513,7 +512,8 @@ internal unsafe class UiDebug { for (var j = 0; j < unitManager->Count; j++) { - if (this.selectedUnitBase == null || unitBaseArray[j] != this.selectedUnitBase) continue; + var unitBase = *(AtkUnitBase**)Unsafe.AsPointer(ref unitManager->EntriesSpan[j]); + if (this.selectedUnitBase == null || unitBase != this.selectedUnitBase) continue; this.selectedInList[i] = true; foundSelected = true; } diff --git a/lib/FFXIVClientStructs b/lib/FFXIVClientStructs index 06e3ca233..fd5ba8a27 160000 --- a/lib/FFXIVClientStructs +++ b/lib/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit 06e3ca2336031ba86ef95d022a2af722e5d00a7e +Subproject commit fd5ba8a27ec911a69eeb93ceb0202091279dfceb