Update showObject, use in gauge pane

This commit is contained in:
Raymond 2021-12-05 12:23:52 -05:00
parent 735292e86c
commit 287c7c8a78
2 changed files with 6 additions and 10 deletions

View file

@ -799,15 +799,7 @@ namespace Dalamud.Interface.Internal.Windows
return;
}
var props = gauge.GetType().GetProperties().OrderBy(prop => prop.Name);
foreach (var prop in props)
{
var result = prop.GetValue(gauge);
if (result.GetType() == typeof(IntPtr))
ImGui.Text($"{prop.Name}: {result:X}");
else
ImGui.Text($"{prop.Name}: {result}");
}
Util.ShowObject(gauge);
}
private void DrawCommand()

View file

@ -174,7 +174,11 @@ namespace Dalamud.Utility
foreach (var propertyInfo in type.GetProperties())
{
ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: {propertyInfo.GetValue(obj)}");
var value = propertyInfo.GetValue(obj);
if (value.GetType() == typeof(IntPtr))
ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: 0x{value:X}");
else
ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: {value}");
}
ImGui.Unindent();