feat: add Util.ShowStruct<T>(T*)

This commit is contained in:
goat 2021-12-08 03:18:18 +01:00
parent 6d22edb390
commit c5237663b8
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -247,6 +247,11 @@ namespace Dalamud.Utility
ImGui.PopStyleVar();
}
public static unsafe void ShowStruct<T>(T* obj, bool autoExpand = false) where T : unmanaged
{
ShowStruct(*obj, (ulong)&obj, autoExpand);
}
/// <summary>
/// Show a GameObject's internal data in an ImGui-context.
/// </summary>
@ -257,13 +262,13 @@ namespace Dalamud.Utility
switch (go)
{
case BattleChara bchara:
ShowStruct(*bchara.Struct, (ulong)bchara.Address, autoExpand);
ShowStruct(bchara.Struct, autoExpand);
break;
case Character chara:
ShowStruct(*chara.Struct, (ulong)chara.Address, autoExpand);
ShowStruct(chara.Struct, autoExpand);
break;
default:
ShowStruct(*go.Struct, (ulong)go.Address, autoExpand);
ShowStruct(go.Struct, autoExpand);
break;
}
}