Minor fixes

This commit is contained in:
Wojtek Figat
2023-09-24 13:20:19 +02:00
parent 959bd33efc
commit 15b1e0a984
2 changed files with 15 additions and 8 deletions

View File

@@ -61,6 +61,8 @@ namespace FlaxEditor.CustomEditors.Editors
}
set
{
if (string.Equals(Path, value, StringComparison.Ordinal))
return;
var v = Values[0];
if (v is BehaviorKnowledgeSelectorAny)
v = new BehaviorKnowledgeSelectorAny(value);
@@ -102,14 +104,6 @@ namespace FlaxEditor.CustomEditors.Editors
// Create menu with tree-like structure and search box
var menu = Utilities.Utils.CreateSearchPopup(out var searchBox, out var tree, 0, true);
var selected = Path;
tree.SelectedChanged += delegate(List<TreeNode> before, List<TreeNode> after)
{
if (after.Count == 1)
{
menu.Hide();
Path = after[0].Tag as string;
}
};
// Empty
var noneNode = new TreeNode
@@ -148,6 +142,14 @@ namespace FlaxEditor.CustomEditors.Editors
goalsNode.ExpandAll(true);
}
tree.SelectedChanged += delegate(List<TreeNode> before, List<TreeNode> after)
{
if (after.Count == 1)
{
menu.Hide();
Path = after[0].Tag as string;
}
};
menu.Show(_label, new Float2(0, _label.Height));
}

View File

@@ -50,6 +50,11 @@ API_STRUCT(NoDefault, MarshalAs=StringAnsi) struct FLAXENGINE_API BehaviorKnowle
{
return Path;
}
String ToString() const
{
return Path.ToString();
}
};
/// <summary>