mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 11:59:21 +01:00
/xldata window refactor (#1257)
Reworks the `/xldata` window so that each individual section is in its own file.
This commit is contained in:
parent
11ea64410e
commit
694159a510
37 changed files with 2701 additions and 1893 deletions
|
|
@ -0,0 +1,66 @@
|
|||
using Dalamud.Game.Gui;
|
||||
using Dalamud.Memory;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Widget for displaying Addon Data.
|
||||
/// </summary>
|
||||
internal unsafe class AddonWidget : IDataWindowWidget
|
||||
{
|
||||
private string inputAddonName = string.Empty;
|
||||
private int inputAddonIndex;
|
||||
private nint findAgentInterfacePtr;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DataKind DataKind { get; init; } = DataKind.Addon;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Load()
|
||||
{
|
||||
this.Ready = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Draw()
|
||||
{
|
||||
var gameGui = Service<GameGui>.Get();
|
||||
|
||||
ImGui.InputText("Addon Name", ref this.inputAddonName, 256);
|
||||
ImGui.InputInt("Addon Index", ref this.inputAddonIndex);
|
||||
|
||||
if (this.inputAddonName.IsNullOrEmpty())
|
||||
return;
|
||||
|
||||
var address = gameGui.GetAddonByName(this.inputAddonName, this.inputAddonIndex);
|
||||
|
||||
if (address == nint.Zero)
|
||||
{
|
||||
ImGui.Text("Null");
|
||||
return;
|
||||
}
|
||||
|
||||
var addon = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)address;
|
||||
var name = MemoryHelper.ReadStringNullTerminated((nint)addon->Name);
|
||||
ImGui.TextUnformatted($"{name} - 0x{address.ToInt64():X}\n v:{addon->IsVisible} x:{addon->X} y:{addon->Y} s:{addon->Scale}, w:{addon->RootNode->Width}, h:{addon->RootNode->Height}");
|
||||
|
||||
if (ImGui.Button("Find Agent"))
|
||||
{
|
||||
this.findAgentInterfacePtr = gameGui.FindAgentInterface(address);
|
||||
}
|
||||
|
||||
if (this.findAgentInterfacePtr != nint.Zero)
|
||||
{
|
||||
ImGui.TextUnformatted($"Agent: 0x{this.findAgentInterfacePtr.ToInt64():X}");
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.Button("C"))
|
||||
ImGui.SetClipboardText(this.findAgentInterfacePtr.ToInt64().ToString("X"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue