Merge pull request #749 from Caraxi/fix-showStruct

(fix) Don't show properties that require parameters in ShowStruct
This commit is contained in:
goaaats 2022-01-31 13:14:27 +01:00 committed by GitHub
commit bcba9ed127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,7 +279,7 @@ namespace Dalamud.Utility
ShowValue(addr, new List<string>(path) { f.Name }, f.FieldType, f.GetValue(obj)); ShowValue(addr, new List<string>(path) { f.Name }, f.FieldType, f.GetValue(obj));
} }
foreach (var p in obj.GetType().GetProperties()) foreach (var p in obj.GetType().GetProperties().Where(p => p.GetGetMethod()?.GetParameters().Length == 0))
{ {
ImGui.TextColored(new Vector4(0.2f, 0.9f, 0.9f, 1), $"{p.PropertyType.Name}"); ImGui.TextColored(new Vector4(0.2f, 0.9f, 0.9f, 1), $"{p.PropertyType.Name}");
ImGui.SameLine(); ImGui.SameLine();
@ -347,7 +347,7 @@ namespace Dalamud.Utility
ImGui.Indent(); ImGui.Indent();
foreach (var propertyInfo in type.GetProperties()) foreach (var propertyInfo in type.GetProperties().Where(p => p.GetGetMethod()?.GetParameters().Length == 0))
{ {
var value = propertyInfo.GetValue(obj); var value = propertyInfo.GetValue(obj);
var valueType = value?.GetType(); var valueType = value?.GetType();