From 5babe8df3f533b9b1ec766d745f9536a71facd30 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Mon, 16 Jan 2023 12:11:04 +0100 Subject: [PATCH] Add refreshing actively opened Layers And Tags asset editor when adding tags from popup #885 --- Source/Editor/CustomEditors/Editors/TagEditor.cs | 3 +++ Source/Editor/Windows/Assets/AssetEditorWindow.cs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Source/Editor/CustomEditors/Editors/TagEditor.cs b/Source/Editor/CustomEditors/Editors/TagEditor.cs index cd1f9a332..462e60b7c 100644 --- a/Source/Editor/CustomEditors/Editors/TagEditor.cs +++ b/Source/Editor/CustomEditors/Editors/TagEditor.cs @@ -257,6 +257,9 @@ namespace FlaxEditor.CustomEditors.Editors var settingsObj = (LayersAndTagsSettings)settingsAsset.Instance; settingsObj.Tags.Add(tagName); settingsAsset.SetInstance(settingsObj); + + // Reload editor window to reflect new tag + assetWindow?.RefreshAsset(); } }; dialog.Closed += popup => diff --git a/Source/Editor/Windows/Assets/AssetEditorWindow.cs b/Source/Editor/Windows/Assets/AssetEditorWindow.cs index cf7b41dca..05a9151c2 100644 --- a/Source/Editor/Windows/Assets/AssetEditorWindow.cs +++ b/Source/Editor/Windows/Assets/AssetEditorWindow.cs @@ -308,6 +308,14 @@ namespace FlaxEditor.Windows.Assets { } + /// + /// Drops any loaded asset data and refreshes the UI state. + /// + public void RefreshAsset() + { + _isWaitingForLoaded = true; + } + /// /// Reloads the asset (window will receive or events). ///