diff --git a/Editor/EncounterBrowserWindow.cs b/Editor/EncounterBrowserWindow.cs index 3aea7ea..26c0b2f 100644 --- a/Editor/EncounterBrowserWindow.cs +++ b/Editor/EncounterBrowserWindow.cs @@ -16,8 +16,19 @@ namespace Jovian.EncounterSystem.Editor { public EncounterTable table; public int index; public IEncounter encounter; + public int depth; + + public bool IsTableHeader => encounter == null; } + private static readonly Color[] DepthColors = { + new(0.35f, 0.55f, 0.85f), // depth 0 — table headers (blue) + new(0.90f, 0.90f, 0.90f), // depth 1 — encounters under table (neutral) + new(0.70f, 0.90f, 0.55f), // depth 2 — chain step 1 (green) + new(0.95f, 0.80f, 0.45f), // depth 3 — chain step 2 (amber) + new(0.85f, 0.65f, 0.90f) // depth 4+ — deeper chain (violet) + }; + private readonly List allRecords = new(); private string searchText = string.Empty; private string kindFilter = AllKinds; @@ -27,6 +38,7 @@ namespace Jovian.EncounterSystem.Editor { private TreeView treeView; private VisualElement detailPane; private ToolbarMenu kindDropdown; + private VisualElement statusBanner; [MenuItem("Jovian/Encounters/Encounter Browser")] public static void Open() { @@ -69,8 +81,26 @@ namespace Jovian.EncounterSystem.Editor { } private void BuildSplit() { - var split = new TwoPaneSplitView(0, 280, TwoPaneSplitViewOrientation.Horizontal); - split.style.flexGrow = 1f; + statusBanner = new VisualElement { + style = { + paddingLeft = 10, + paddingRight = 10, + paddingTop = 8, + paddingBottom = 8, + marginBottom = 2, + flexDirection = FlexDirection.Column, + backgroundColor = new StyleColor(new Color(0.85f, 0.4f, 0.15f, 0.35f)), + display = DisplayStyle.None + } + }; + rootVisualElement.Add(statusBanner); + + var split = new VisualElement { + style = { + flexDirection = FlexDirection.Row, + flexGrow = 1f + } + }; rootVisualElement.Add(split); treeView = new TreeView { @@ -80,7 +110,10 @@ namespace Jovian.EncounterSystem.Editor { selectionType = SelectionType.Single }; treeView.selectionChanged += OnSelectionChanged; - treeView.style.flexGrow = 1f; + treeView.style.width = 280; + treeView.style.flexShrink = 0f; + treeView.style.borderRightWidth = 1; + treeView.style.borderRightColor = new StyleColor(new Color(0f, 0f, 0f, 0.4f)); split.Add(treeView); detailPane = new ScrollView(ScrollViewMode.Vertical) { @@ -97,7 +130,9 @@ namespace Jovian.EncounterSystem.Editor { alignItems = Align.Center, paddingLeft = 6, paddingRight = 6, - height = 22 + height = 22, + flexGrow = 1f, + flexShrink = 0f } }; @@ -125,6 +160,19 @@ namespace Jovian.EncounterSystem.Editor { }; row.Add(label); + var selectButton = new Button { + name = "select-button", + text = "Select", + style = { + marginLeft = 4, + marginRight = 0, + paddingLeft = 6, + paddingRight = 6, + display = DisplayStyle.None + } + }; + row.Add(selectButton); + return row; } @@ -132,9 +180,34 @@ namespace Jovian.EncounterSystem.Editor { var record = treeView.GetItemDataForIndex(index); var label = element.Q