Merge branch 'save-collection-groups' of https://github.com/Tryibion/FlaxEngine into Tryibion-save-collection-groups

# Conflicts:
#	Source/Editor/CustomEditors/Editors/CollectionEditor.cs
This commit is contained in:
Wojtek Figat
2024-08-30 13:17:46 +02:00
3 changed files with 111 additions and 6 deletions

View File

@@ -74,11 +74,11 @@ namespace FlaxEditor.CustomEditors
{
var element = Group(title, useTransparentHeader);
element.Panel.Tag = linkedEditor;
element.Panel.MouseButtonRightClicked += OnGroupPanelMouseButtonRightClicked;
element.Panel.MouseButtonRightClicked += (panel, location) => OnGroupPanelMouseButtonRightClicked(element, panel, location);
return element;
}
private void OnGroupPanelMouseButtonRightClicked(DropPanel groupPanel, Float2 location)
private void OnGroupPanelMouseButtonRightClicked(GroupElement element, DropPanel groupPanel, Float2 location)
{
var linkedEditor = (CustomEditor)groupPanel.Tag;
var menu = new ContextMenu();
@@ -91,6 +91,7 @@ namespace FlaxEditor.CustomEditors
menu.AddButton("Copy", linkedEditor.Copy);
var paste = menu.AddButton("Paste", linkedEditor.Paste);
paste.Enabled = linkedEditor.CanPaste;
element.SetupContextMenu?.Invoke(menu, groupPanel);
menu.Show(groupPanel, location);
}