diff --git a/Penumbra/Interop/ResourceTree/ResolveContext.cs b/Penumbra/Interop/ResourceTree/ResolveContext.cs index 72a5be69..8e553091 100644 --- a/Penumbra/Interop/ResourceTree/ResolveContext.cs +++ b/Penumbra/Interop/ResourceTree/ResolveContext.cs @@ -283,12 +283,17 @@ static ushort GetTextureIndex(ushort texFlags) var node = CreateNodeFromResourceHandle(ResourceType.Sklb, (nint)sklb, (ResourceHandle*)sklb->SkeletonResourceHandle, false, WithUIData); if (node != null) + { + var skpNode = CreateParameterNodeFromPartialSkeleton(sklb); + if (skpNode != null) + node.Children.Add(skpNode); Nodes.Add((nint)sklb->SkeletonResourceHandle, node); + } return node; } - public unsafe ResourceNode? CreateParameterNodeFromPartialSkeleton(FFXIVClientStructs.FFXIV.Client.Graphics.Render.PartialSkeleton* sklb) + private unsafe ResourceNode? CreateParameterNodeFromPartialSkeleton(FFXIVClientStructs.FFXIV.Client.Graphics.Render.PartialSkeleton* sklb) { if (sklb->SkeletonParameterResourceHandle == null) return null; @@ -298,7 +303,11 @@ static ushort GetTextureIndex(ushort texFlags) var node = CreateNodeFromResourceHandle(ResourceType.Skp, (nint)sklb, (ResourceHandle*)sklb->SkeletonParameterResourceHandle, true, WithUIData); if (node != null) + { + if (WithUIData) + node = node.WithUIData("Skeleton Parameters", node.Icon); Nodes.Add((nint)sklb->SkeletonParameterResourceHandle, node); + } return node; } diff --git a/Penumbra/Interop/ResourceTree/ResourceTree.cs b/Penumbra/Interop/ResourceTree/ResourceTree.cs index c6e90c6b..db3b287f 100644 --- a/Penumbra/Interop/ResourceTree/ResourceTree.cs +++ b/Penumbra/Interop/ResourceTree/ResourceTree.cs @@ -134,10 +134,6 @@ private unsafe void AddSkeleton(List nodes, ResolveContext context var sklbNode = context.CreateNodeFromPartialSkeleton(&skeleton->PartialSkeletons[i]); if (sklbNode != null) nodes.Add(context.WithUIData ? sklbNode.WithUIData($"{prefix}Skeleton #{i}", sklbNode.Icon) : sklbNode); - - var skpNode = context.CreateParameterNodeFromPartialSkeleton(&skeleton->PartialSkeletons[i]); - if (skpNode != null) - nodes.Add(context.WithUIData ? skpNode.WithUIData($"{prefix}Skeleton #{i} Parameters", skpNode.Icon) : skpNode); } } } diff --git a/Penumbra/UI/AdvancedWindow/ResourceTreeViewer.cs b/Penumbra/UI/AdvancedWindow/ResourceTreeViewer.cs index 528f19c1..f0cf6030 100644 --- a/Penumbra/UI/AdvancedWindow/ResourceTreeViewer.cs +++ b/Penumbra/UI/AdvancedWindow/ResourceTreeViewer.cs @@ -8,7 +8,8 @@ using OtterGui; using Penumbra.Interop.ResourceTree; using Penumbra.UI.Classes; - +using System.Linq; + namespace Penumbra.UI.AdvancedWindow; public class ResourceTreeViewer @@ -125,7 +126,10 @@ private void DrawNodes(IEnumerable resourceNodes, int level, nint var unfolded = _unfolded.Contains(nodePathHash); using (var indent = ImRaii.PushIndent(level)) { - if (resourceNode.Children.Count > 0) + var unfoldable = debugMode + ? resourceNode.Children.Count > 0 + : resourceNode.Children.Any(child => !child.Internal); + if (unfoldable) { using var font = ImRaii.PushFont(UiBuilder.IconFont); var icon = (unfolded ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight).ToIconString(); @@ -142,7 +146,7 @@ private void DrawNodes(IEnumerable resourceNodes, int level, nint _changedItemDrawer.DrawCategoryIcon(resourceNode.Icon); ImGui.SameLine(0f, ImGui.GetStyle().ItemInnerSpacing.X); ImGui.TableHeader(resourceNode.Name); - if (ImGui.IsItemClicked() && resourceNode.Children.Count > 0) + if (ImGui.IsItemClicked() && unfoldable) { if (unfolded) _unfolded.Remove(nodePathHash);