mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
Add support with Addon.Width and Addon.Height
Using Aers' AtkResNode struct from https://github.com/aers/FFXIVClientStructs/blob/main/Component/GUI/AtkResNode.cs
This commit is contained in:
parent
c589e223da
commit
066ab30acc
4 changed files with 54 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ namespace Dalamud.Game.Internal.Gui.Addon {
|
||||||
public short Y => this.addonStruct.Y;
|
public short Y => this.addonStruct.Y;
|
||||||
public float Scale => this.addonStruct.Scale;
|
public float Scale => this.addonStruct.Scale;
|
||||||
|
|
||||||
|
public unsafe ushort Width => this.addonStruct.RootNode->Width;
|
||||||
|
public unsafe ushort Height => this.addonStruct.RootNode->Height;
|
||||||
public bool Visible => (this.addonStruct.Flags & 0x20) == 0x20;
|
public bool Visible => (this.addonStruct.Flags & 0x20) == 0x20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ namespace Dalamud.Game.Internal.Gui.Structs {
|
||||||
|
|
||||||
public class AddonOffsets {
|
public class AddonOffsets {
|
||||||
public const int Name = 0x8;
|
public const int Name = 0x8;
|
||||||
|
public const int RootNode = 0xC8;
|
||||||
public const int Flags = 0x182;
|
public const int Flags = 0x182;
|
||||||
public const int X = 0x1BC;
|
public const int X = 0x1BC;
|
||||||
public const int Y = 0x1BE;
|
public const int Y = 0x1BE;
|
||||||
|
|
@ -19,6 +20,7 @@ namespace Dalamud.Game.Internal.Gui.Structs {
|
||||||
[FieldOffset(AddonOffsets.X)] public short X;
|
[FieldOffset(AddonOffsets.X)] public short X;
|
||||||
[FieldOffset(AddonOffsets.Y)] public short Y;
|
[FieldOffset(AddonOffsets.Y)] public short Y;
|
||||||
[FieldOffset(AddonOffsets.Scale)] public float Scale;
|
[FieldOffset(AddonOffsets.Scale)] public float Scale;
|
||||||
|
[FieldOffset(AddonOffsets.RootNode)] public unsafe AtkResNode* RootNode;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
49
Dalamud/Game/Internal/Gui/Structs/AtkResNode.cs
Normal file
49
Dalamud/Game/Internal/Gui/Structs/AtkResNode.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Dalamud.Game.Internal.Gui.Structs {
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Explicit, Size = 0xA8)]
|
||||||
|
|
||||||
|
// https://github.com/aers/FFXIVClientStructs/blob/main/Component/GUI/AtkResNode.cs
|
||||||
|
public unsafe struct AtkResNode {
|
||||||
|
[FieldOffset(0x0)] public IntPtr AtkEventTarget;
|
||||||
|
[FieldOffset(0x8)] public uint NodeID;
|
||||||
|
[FieldOffset(0x20)] public AtkResNode* ParentNode;
|
||||||
|
[FieldOffset(0x28)] public AtkResNode* PrevSiblingNode;
|
||||||
|
[FieldOffset(0x30)] public AtkResNode* NextSiblingNode;
|
||||||
|
[FieldOffset(0x38)] public AtkResNode* ChildNode;
|
||||||
|
[FieldOffset(0x40)] public ushort Type;
|
||||||
|
[FieldOffset(0x42)] public ushort ChildCount;
|
||||||
|
[FieldOffset(0x44)] public float X;
|
||||||
|
[FieldOffset(0x48)] public float Y;
|
||||||
|
[FieldOffset(0x4C)] public float ScaleX;
|
||||||
|
[FieldOffset(0x50)] public float ScaleY;
|
||||||
|
[FieldOffset(0x54)] public float Rotation;
|
||||||
|
[FieldOffset(0x58)] public fixed float UnkMatrix[3 * 2];
|
||||||
|
[FieldOffset(0x70)] public uint Color;
|
||||||
|
[FieldOffset(0x74)] public float Depth;
|
||||||
|
[FieldOffset(0x78)] public float Depth_2;
|
||||||
|
[FieldOffset(0x7C)] public ushort AddRed;
|
||||||
|
[FieldOffset(0x7E)] public ushort AddGreen;
|
||||||
|
[FieldOffset(0x80)] public ushort AddBlue;
|
||||||
|
[FieldOffset(0x82)] public ushort AddRed_2;
|
||||||
|
[FieldOffset(0x84)] public ushort AddGreen_2;
|
||||||
|
[FieldOffset(0x86)] public ushort AddBlue_2;
|
||||||
|
[FieldOffset(0x88)] public byte MultiplyRed;
|
||||||
|
[FieldOffset(0x89)] public byte MultiplyGreen;
|
||||||
|
[FieldOffset(0x8A)] public byte MultiplyBlue;
|
||||||
|
[FieldOffset(0x8B)] public byte MultiplyRed_2;
|
||||||
|
[FieldOffset(0x8C)] public byte MultiplyGreen_2;
|
||||||
|
[FieldOffset(0x8D)] public byte MultiplyBlue_2;
|
||||||
|
[FieldOffset(0x8E)] public byte Alpha_2;
|
||||||
|
[FieldOffset(0x8F)] public byte UnkByte_1;
|
||||||
|
[FieldOffset(0x90)] public ushort Width;
|
||||||
|
[FieldOffset(0x92)] public ushort Height;
|
||||||
|
[FieldOffset(0x94)] public float OriginX;
|
||||||
|
[FieldOffset(0x98)] public float OriginY;
|
||||||
|
[FieldOffset(0x9C)] public ushort Priority;
|
||||||
|
[FieldOffset(0x9E)] public short Flags;
|
||||||
|
[FieldOffset(0xA0)] public uint Flags_2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -301,7 +301,7 @@ namespace Dalamud.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.resultAddon != null) {
|
if (this.resultAddon != null) {
|
||||||
ImGui.TextUnformatted($"{this.resultAddon.Name} - 0x{this.resultAddon.Address.ToInt64():x}\n v:{this.resultAddon.Visible} x:{this.resultAddon.X} y:{this.resultAddon.Y} s:{this.resultAddon.Scale}");
|
ImGui.TextUnformatted($"{this.resultAddon.Name} - 0x{this.resultAddon.Address.ToInt64():x}\n v:{this.resultAddon.Visible} x:{this.resultAddon.X} y:{this.resultAddon.Y} s:{this.resultAddon.Scale}, w:{this.resultAddon.Width}, h:{this.resultAddon.Height}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Button("Get Base UI object")) {
|
if (ImGui.Button("Get Base UI object")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue