Fix build

This commit is contained in:
Haselnussbomber 2025-07-31 00:08:08 +02:00
parent 59003f8cd5
commit a358331b9f
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
6 changed files with 7 additions and 9 deletions

View file

@ -140,7 +140,7 @@ internal unsafe class PluginEventController : IDisposable
if (currentAddonPointer != eventEntry.Addon) return; if (currentAddonPointer != eventEntry.Addon) return;
// Make sure the addon is not unloaded // Make sure the addon is not unloaded
var atkUnitBase = (AtkUnitBase*)currentAddonPointer; var atkUnitBase = currentAddonPointer.Struct;
if (atkUnitBase->UldManager.LoadedState == AtkLoadState.Unloaded) return; if (atkUnitBase->UldManager.LoadedState == AtkLoadState.Unloaded) return;
// Does this addon contain the node this event is for? (by address) // Does this addon contain the node this event is for? (by address)

View file

@ -330,7 +330,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
this.entriesReadOnlyCopy = null; this.entriesReadOnlyCopy = null;
} }
private AtkUnitBase* GetDtr() => (AtkUnitBase*)this.gameGui.GetAddonByName("_DTR").ToPointer(); private AtkUnitBase* GetDtr() => this.gameGui.GetAddonByName("_DTR").Struct;
private void Update(IFramework unused) private void Update(IFramework unused)
{ {

View file

@ -72,7 +72,7 @@ internal sealed class NamePlateGui : IInternalDisposableService, INamePlateGui
/// <inheritdoc/> /// <inheritdoc/>
public unsafe void RequestRedraw() public unsafe void RequestRedraw()
{ {
var addon = (AddonNamePlate*)this.gameGui.GetAddonByName("NamePlate"); var addon = (AddonNamePlate*)(nint)this.gameGui.GetAddonByName("NamePlate");
if (addon != null) if (addon != null)
{ {
addon->DoFullUpdate = 1; addon->DoFullUpdate = 1;

View file

@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using FFXIVClientStructs.Interop;
namespace Dalamud.Game.Gui.NativeWrapper; namespace Dalamud.Game.Gui.NativeWrapper;

View file

@ -81,7 +81,7 @@ public unsafe partial class AddonTree : IDisposable
{ {
var ptr = GameGui.GetAddonByName(name); var ptr = GameGui.GetAddonByName(name);
if ((AtkUnitBase*)ptr != null) if (!ptr.IsNull)
{ {
if (AddonTrees.TryGetValue(name, out var tree)) if (AddonTrees.TryGetValue(name, out var tree))
{ {
@ -234,7 +234,7 @@ public unsafe partial class AddonTree : IDisposable
/// <returns>true if the addon is found.</returns> /// <returns>true if the addon is found.</returns>
private bool ValidateAddon(out AtkUnitBase* addon) private bool ValidateAddon(out AtkUnitBase* addon)
{ {
addon = (AtkUnitBase*)GameGui.GetAddonByName(this.AddonName); addon = GameGui.GetAddonByName(this.AddonName).Struct;
if (addon == null || (nint)addon != this.InitialPtr) if (addon == null || (nint)addon != this.InitialPtr)
{ {
this.Dispose(); this.Dispose();

View file

@ -1,4 +1,4 @@
using Dalamud.Game.Gui; using Dalamud.Game.Gui;
using Dalamud.Memory; using Dalamud.Memory;
using Dalamud.Utility; using Dalamud.Utility;
using ImGuiNET; using ImGuiNET;
@ -48,7 +48,7 @@ internal unsafe class AddonWidget : IDataWindowWidget
return; return;
} }
var addon = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)address; var addon = address.Struct;
var name = addon->NameString; var name = addon->NameString;
ImGui.TextUnformatted($"{name} - {Util.DescribeAddress(address)}\n v:{addon->IsVisible} x:{addon->X} y:{addon->Y} s:{addon->Scale}, w:{addon->RootNode->Width}, h:{addon->RootNode->Height}"); ImGui.TextUnformatted($"{name} - {Util.DescribeAddress(address)}\n v:{addon->IsVisible} x:{addon->X} y:{addon->Y} s:{addon->Scale}, w:{addon->RootNode->Width}, h:{addon->RootNode->Height}");