mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Resource Tree: Make skp child of sklb
This commit is contained in:
parent
30c622c085
commit
a17a1e9576
3 changed files with 17 additions and 8 deletions
|
|
@ -8,7 +8,8 @@ using OtterGui.Raii;
|
|||
using OtterGui;
|
||||
using Penumbra.Interop.ResourceTree;
|
||||
using Penumbra.UI.Classes;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public class ResourceTreeViewer
|
||||
|
|
@ -125,7 +126,10 @@ public class ResourceTreeViewer
|
|||
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 @@ public class ResourceTreeViewer
|
|||
_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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue