Groups now get filtered by box type when added after the context menu was opened

This commit is contained in:
Nils Hausfeld
2023-09-25 21:58:05 +02:00
parent 33c51d0a8e
commit 3b393ef4db
2 changed files with 20 additions and 2 deletions

View File

@@ -288,6 +288,10 @@ namespace FlaxEditor.Surface.ContextMenu
OnSearchFilterChanged();
}
}
else
{
group.EvaluateVisibilityWithBox(_selectedBox);
}
Profiler.EndEvent();
}
@@ -321,6 +325,7 @@ namespace FlaxEditor.Surface.ContextMenu
Parent = group
};
}
group.EvaluateVisibilityWithBox(_selectedBox);
group.SortChildren();
group.Parent = _groupsPanel;
_groups.Add(group);

View File

@@ -117,10 +117,23 @@ namespace FlaxEditor.Surface.ContextMenu
public bool CanConnectTo(Box startBox)
{
if (startBox == null)
return true;
{
Visible = true;
return true;
}
if (_archetype.Title == "GetChild")
{
Debug.Log("");
Debug.Log(_archetype.Create == null);
Debug.Log(_archetype.Create.GetType() == typeof(FlaxEditor.Surface.Archetypes.Function.MethodOverrideNode));
}
if(_archetype?.Elements == null)
if (_archetype?.Elements == null)
{
Visible = false;
return false;
}
bool isCompatible = false;
foreach (NodeElementArchetype element in _archetype.Elements)