- Added the ability to rename selected visject comments by pressing F2

- Added rename option to context menu for visject comments
This commit is contained in:
Nils Hausfeld
2024-12-07 18:42:00 +01:00
parent 0cf31395b5
commit 82453acf53

View File

@@ -172,10 +172,21 @@ namespace FlaxEditor.Surface
/// <inheritdoc />
public override void Update(float deltaTime)
{
if (_isRenaming && (!_renameTextBox.IsFocused || !RootWindow.IsFocused))
if (_isRenaming)
{
Rename(_renameTextBox.Text);
StopRenaming();
// Stop renaming when clicking anywhere else
if (!_renameTextBox.IsFocused || !RootWindow.IsFocused)
{
Rename(_renameTextBox.Text);
StopRenaming();
}
}
else
{
if (IsSelected && Input.GetKeyDown(KeyboardKeys.F2))
{
StartRenaming();
}
}
base.Update(deltaTime);
@@ -417,6 +428,12 @@ namespace FlaxEditor.Surface
base.OnShowSecondaryContextMenu(menu, location);
menu.AddSeparator();
menu.AddButton("Rename", () =>
{
if(!_isRenaming)
StartRenaming();
});
ContextMenuChildMenu cmOrder = menu.AddChildMenu("Order");
{
cmOrder.ContextMenu.AddButton("Bring Forward", () =>