Update sprite group name when sprite name is changed.
This commit is contained in:
@@ -6,6 +6,7 @@ using FlaxEditor.Content;
|
|||||||
using FlaxEditor.Content.Import;
|
using FlaxEditor.Content.Import;
|
||||||
using FlaxEditor.CustomEditors;
|
using FlaxEditor.CustomEditors;
|
||||||
using FlaxEditor.CustomEditors.Editors;
|
using FlaxEditor.CustomEditors.Editors;
|
||||||
|
using FlaxEditor.CustomEditors.Elements;
|
||||||
using FlaxEditor.GUI;
|
using FlaxEditor.GUI;
|
||||||
using FlaxEditor.GUI.ContextMenu;
|
using FlaxEditor.GUI.ContextMenu;
|
||||||
using FlaxEditor.Scripting;
|
using FlaxEditor.Scripting;
|
||||||
@@ -133,9 +134,20 @@ namespace FlaxEditor.Windows.Assets
|
|||||||
group.Panel.Tag = i;
|
group.Panel.Tag = i;
|
||||||
group.Panel.MouseButtonRightClicked += OnGroupPanelMouseButtonRightClicked;
|
group.Panel.MouseButtonRightClicked += OnGroupPanelMouseButtonRightClicked;
|
||||||
group.Object(new ListValueContainer(elementType, i, Values));
|
group.Object(new ListValueContainer(elementType, i, Values));
|
||||||
|
|
||||||
|
var stringNameElement = group.Editors[0].ChildrenEditors.Find(x => x is StringEditor).Layout.Children.Find(x => x is TextBoxElement) as TextBoxElement;
|
||||||
|
if (stringNameElement != null)
|
||||||
|
{
|
||||||
|
stringNameElement.TextBox.TextBoxEditEnd += (textbox) => OnNameChanged(group.Panel, (TextBox)textbox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNameChanged(DropPanel panel, TextBox textbox)
|
||||||
|
{
|
||||||
|
panel.HeaderText = textbox.Text;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnGroupPanelMouseButtonRightClicked(DropPanel groupPanel, Float2 location)
|
private void OnGroupPanelMouseButtonRightClicked(DropPanel groupPanel, Float2 location)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user