mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 21:24:16 +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();
|
ImGui.PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static unsafe void ShowStruct<T>(T* obj, bool autoExpand = false) where T : unmanaged
|
||||||
|
{
|
||||||
|
ShowStruct(*obj, (ulong)&obj, autoExpand);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show a GameObject's internal data in an ImGui-context.
|
/// Show a GameObject's internal data in an ImGui-context.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -257,13 +262,13 @@ namespace Dalamud.Utility
|
||||||
switch (go)
|
switch (go)
|
||||||
{
|
{
|
||||||
case BattleChara bchara:
|
case BattleChara bchara:
|
||||||
ShowStruct(*bchara.Struct, (ulong)bchara.Address, autoExpand);
|
ShowStruct(bchara.Struct, autoExpand);
|
||||||
break;
|
break;
|
||||||
case Character chara:
|
case Character chara:
|
||||||
ShowStruct(*chara.Struct, (ulong)chara.Address, autoExpand);
|
ShowStruct(chara.Struct, autoExpand);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ShowStruct(*go.Struct, (ulong)go.Address, autoExpand);
|
ShowStruct(go.Struct, autoExpand);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue