mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: add Util.ShowStruct<T>(T*)
This commit is contained in:
parent
6d22edb390
commit
c5237663b8
1 changed files with 8 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue