forked from Caraxi/SimpleTweaksPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRetainersDebugging.cs
More file actions
66 lines (55 loc) · 2.37 KB
/
RetainersDebugging.cs
File metadata and controls
66 lines (55 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System.Numerics;
using Dalamud.Interface.Textures;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.Interop;
using ImGuiNET;
namespace SimpleTweaksPlugin.Debugging;
public unsafe class RetainersDebugging : DebugHelper {
public override string Name => "Retainer Debugging";
public override void Draw() {
var retainerManager = RetainerManager.Instance();
ImGui.Text("Retainer Manager: ");
ImGui.SameLine();
DebugManager.ClickToCopy(retainerManager);
if (retainerManager == null) return;
ImGui.SameLine();
DebugManager.PrintOutObject(retainerManager);
ImGui.Separator();
ImGui.Text("Order: ");
for (var i = 0; i < 10 && i < retainerManager->Retainers.Length; i++) {
ImGui.SameLine();
ImGui.Text($"{retainerManager->DisplayOrder[i]:X2}");
}
ImGui.Separator();
if (ImGui.BeginTable("retainers", 4)) {
ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 120);
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 120);
ImGui.TableSetupColumn("Job", ImGuiTableColumnFlags.WidthFixed, 80);
ImGui.TableSetupColumn("Struct", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableHeadersRow();
foreach (var r in retainerManager->Retainers.PointerEnumerator()) {
if (r->RetainerId == 0) continue;
ImGui.TableNextColumn();
DebugManager.ClickToCopyText($"{r->RetainerId:X}");
ImGui.TableNextColumn();
ImGui.Text($"{r->NameString}");
ImGui.TableNextColumn();
if (r->ClassJob == 0) {
ImGui.Text("No Class");
} else {
var icon = Service.TextureProvider.GetFromGameIcon(new GameIconLookup((uint)(62100 + r->ClassJob))).GetWrapOrDefault();
if (icon != null) {
ImGui.Image(icon.ImGuiHandle, new Vector2(24));
} else {
ImGui.Text($"[{r->ClassJob}]");
}
ImGui.SameLine();
ImGui.Text($"{r->Level}");
}
ImGui.TableNextColumn();
DebugManager.PrintOutObject(r);
}
ImGui.EndTable();
}
}
}