From 287c7c8a78ac19f28ecf5e80839382397209a183 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 5 Dec 2021 12:23:52 -0500 Subject: [PATCH] Update showObject, use in gauge pane --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 10 +--------- Dalamud/Utility/Util.cs | 6 +++++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index f1da04c80..724728c63 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -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() diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index 658ebb79c..e903badd9 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -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();