From 2a0589b4c151140bed585e09c02646eef25abbc9 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 19 Sep 2026 23:26:35 +0200 Subject: [PATCH] Add context menu option to show asset in Content window quickly --- Source/Editor/Windows/Assets/AssetEditorWindow.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Windows/Assets/AssetEditorWindow.cs b/Source/Editor/Windows/Assets/AssetEditorWindow.cs index 16a2cf839..c57e391b2 100644 --- a/Source/Editor/Windows/Assets/AssetEditorWindow.cs +++ b/Source/Editor/Windows/Assets/AssetEditorWindow.cs @@ -53,7 +53,7 @@ namespace FlaxEditor.Windows.Assets { Parent = this }; - _toolstrip.AddButton(editor.Icons.Search64, () => Editor.Windows.ContentWin.Select(_item)).LinkTooltip("Show and select in Content Window."); + _toolstrip.AddButton(editor.Icons.Search64, ShowInContent).LinkTooltip("Show and select in Content Window."); InputActions.Add(options => options.Save, Save); @@ -150,6 +150,11 @@ namespace FlaxEditor.Windows.Assets { } + private void ShowInContent() + { + Editor.Windows.ContentWin.Select(_item); + } + /// protected override void OnClose() { @@ -178,7 +183,9 @@ namespace FlaxEditor.Windows.Assets base.OnDestroy(); } - /// + /// + /// Called when scripts reloading begins. + /// protected virtual void OnScriptsReloadBegin() { if (!IsHidden) @@ -269,7 +276,8 @@ namespace FlaxEditor.Windows.Assets base.OnShowContextMenu(menu); menu.AddButton("Save", Save).Enabled = IsEdited; - menu.AddButton("Copy name", () => Clipboard.Text = Item.NamePath); + menu.AddButton("Copy Name", () => Clipboard.Text = Item.NamePath); + menu.AddButton("Show In Content", ShowInContent); menu.AddSeparator(); }