Add ContentItem.OnContextMenu
This commit is contained in:
@@ -505,6 +505,14 @@ namespace FlaxEditor.Content
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when context menu is being prepared to show. Can be used to add custom options.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="menu">The menu.</param>
|
||||||
|
public virtual void OnContextMenu(FlaxEditor.GUI.ContextMenu.ContextMenu menu)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when item gets renamed or location gets changed (path modification).
|
/// Called when item gets renamed or location gets changed (path modification).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ namespace FlaxEditor.Windows
|
|||||||
// Custom options
|
// Custom options
|
||||||
ContextMenuShow?.Invoke(cm, item);
|
ContextMenuShow?.Invoke(cm, item);
|
||||||
proxy?.OnContentWindowContextMenu(cm, item);
|
proxy?.OnContentWindowContextMenu(cm, item);
|
||||||
|
item.OnContextMenu(cm);
|
||||||
|
|
||||||
cm.AddButton("Copy name to Clipboard", () => Clipboard.Text = item.NamePath);
|
cm.AddButton("Copy name to Clipboard", () => Clipboard.Text = item.NamePath);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user