@@ -9,7 +9,6 @@ using FlaxEditor.CustomEditors.Elements;
|
|||||||
using FlaxEditor.GUI;
|
using FlaxEditor.GUI;
|
||||||
using FlaxEditor.GUI.ContextMenu;
|
using FlaxEditor.GUI.ContextMenu;
|
||||||
using FlaxEditor.GUI.Tree;
|
using FlaxEditor.GUI.Tree;
|
||||||
using FlaxEditor.Modules;
|
|
||||||
using FlaxEditor.Scripting;
|
using FlaxEditor.Scripting;
|
||||||
using FlaxEditor.Windows;
|
using FlaxEditor.Windows;
|
||||||
using FlaxEditor.Windows.Assets;
|
using FlaxEditor.Windows.Assets;
|
||||||
@@ -263,7 +262,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
|||||||
if (editor.Values.GetAttributes().FirstOrDefault(x => x is EditorDisplayAttribute) is EditorDisplayAttribute editorDisplayAttribute && !string.IsNullOrEmpty(editorDisplayAttribute.Name))
|
if (editor.Values.GetAttributes().FirstOrDefault(x => x is EditorDisplayAttribute) is EditorDisplayAttribute editorDisplayAttribute && !string.IsNullOrEmpty(editorDisplayAttribute.Name))
|
||||||
node.Text = $"{Utilities.Utils.GetPropertyNameUI(editorDisplayAttribute.Name)} ({Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name)})";
|
node.Text = $"{Utilities.Utils.GetPropertyNameUI(editorDisplayAttribute.Name)} ({Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name)})";
|
||||||
else
|
else
|
||||||
node.Text = $"{Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name)}";
|
node.Text = Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name);
|
||||||
}
|
}
|
||||||
else if (sceneObject is Actor actor)
|
else if (sceneObject is Actor actor)
|
||||||
node.Text = $"{actor.Name} ({Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name)})";
|
node.Text = $"{actor.Name} ({Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name)})";
|
||||||
|
|||||||
@@ -760,20 +760,21 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
// Show tree guidelines
|
// Show tree guidelines
|
||||||
if (Editor.Instance.Options.Options.Interface.ShowTreeLines)
|
if (Editor.Instance.Options.Options.Interface.ShowTreeLines)
|
||||||
{
|
{
|
||||||
TreeNode parentNode = Parent as TreeNode;
|
ContainerControl parent = Parent;
|
||||||
|
TreeNode parentNode = parent as TreeNode;
|
||||||
bool thisNodeIsLast = false;
|
bool thisNodeIsLast = false;
|
||||||
while (parentNode != null && (parentNode != ParentTree.Children[0] || _tree.DrawRootTreeLine))
|
while (parentNode != null && (parentNode != tree.Children[0] || tree.DrawRootTreeLine))
|
||||||
{
|
{
|
||||||
float bottomOffset = 0;
|
float bottomOffset = 0;
|
||||||
float topOffset = 0;
|
float topOffset = 0;
|
||||||
|
|
||||||
if (Parent == parentNode && this == Parent.Children[0])
|
if (parent == parentNode && this == parent.Children[0])
|
||||||
topOffset = 2;
|
topOffset = 2;
|
||||||
|
|
||||||
if (thisNodeIsLast && parentNode.Children.Count == 1)
|
if (thisNodeIsLast && parentNode.Children.Count == 1)
|
||||||
bottomOffset = topOffset != 0 ? 4 : 2;
|
bottomOffset = topOffset != 0 ? 4 : 2;
|
||||||
|
|
||||||
if (Parent == parentNode && this == Parent.Children[^1] && !_opened)
|
if (parent == parentNode && this == parent.Children[^1] && !_opened)
|
||||||
{
|
{
|
||||||
thisNodeIsLast = true;
|
thisNodeIsLast = true;
|
||||||
bottomOffset = topOffset != 0 ? 4 : 2;
|
bottomOffset = topOffset != 0 ? 4 : 2;
|
||||||
@@ -784,6 +785,8 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
if (_iconCollaped.IsValid)
|
if (_iconCollaped.IsValid)
|
||||||
leftOffset += 18;
|
leftOffset += 18;
|
||||||
var lineRect1 = new Rectangle(parentNode.TextRect.Left - leftOffset, parentNode.HeaderRect.Top + topOffset, 1, parentNode.HeaderRect.Height - bottomOffset);
|
var lineRect1 = new Rectangle(parentNode.TextRect.Left - leftOffset, parentNode.HeaderRect.Top + topOffset, 1, parentNode.HeaderRect.Height - bottomOffset);
|
||||||
|
if (HasAnyVisibleChild && CustomArrowRect.HasValue && CustomArrowRect.Value.Intersects(lineRect1))
|
||||||
|
lineRect1 = Rectangle.Empty; // Skip drawing line if it's overlapping the arrow rectangle
|
||||||
Render2D.FillRectangle(lineRect1, isSelected ? style.ForegroundGrey : style.LightBackground);
|
Render2D.FillRectangle(lineRect1, isSelected ? style.ForegroundGrey : style.LightBackground);
|
||||||
parentNode = parentNode.Parent as TreeNode;
|
parentNode = parentNode.Parent as TreeNode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ namespace FlaxEditor.Windows
|
|||||||
// Content structure tree
|
// Content structure tree
|
||||||
_tree = new Tree(false)
|
_tree = new Tree(false)
|
||||||
{
|
{
|
||||||
|
DrawRootTreeLine = false,
|
||||||
Parent = _contentTreePanel,
|
Parent = _contentTreePanel,
|
||||||
};
|
};
|
||||||
_tree.SelectedChanged += OnTreeSelectionChanged;
|
_tree.SelectedChanged += OnTreeSelectionChanged;
|
||||||
|
|||||||
Reference in New Issue
Block a user