From f5ad8566ebf22d48805cd643f29fe766d60a7121 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 2 May 2025 13:29:01 +0200 Subject: [PATCH] make path creation method more generalized --- Source/Editor/Utilities/Utils.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Editor/Utilities/Utils.cs b/Source/Editor/Utilities/Utils.cs index ad2ee87a2..7c7d3d2d2 100644 --- a/Source/Editor/Utilities/Utils.cs +++ b/Source/Editor/Utilities/Utils.cs @@ -402,31 +402,31 @@ namespace FlaxEditor.Utilities /// /// Creates an Import path ui that show the asset import path and adds a button to show the folder in the file system. /// - /// The parent group element. + /// The parent layout element. /// The asset item to get the import path of. - public static void CreateImportPathUI(CustomEditors.Elements.GroupElement group, Content.BinaryAssetItem assetItem) + public static void CreateImportPathUI(CustomEditors.LayoutElementsContainer parentLayout, Content.BinaryAssetItem assetItem) { assetItem.GetImportPath(out var path); - CreateImportPathUI(group, path); + CreateImportPathUI(parentLayout, path); } /// /// Creates an Import path ui that show the import path and adds a button to show the folder in the file system. /// - /// The parent group element. + /// The parent layout element. /// The import path. /// Whether to use an initial layout space of 5 for separation. - public static void CreateImportPathUI(CustomEditors.Elements.GroupElement group, string path, bool useInitialSpacing = true) + public static void CreateImportPathUI(CustomEditors.LayoutElementsContainer parentLayout, string path, bool useInitialSpacing = true) { if (!string.IsNullOrEmpty(path)) { if (useInitialSpacing) - group.Space(0); - var textBox = group.TextBox().TextBox; + parentLayout.Space(0); + var textBox = parentLayout.TextBox().TextBox; textBox.TooltipText = "Source asset path. Can be relative or absolute to the project. Path is not editable here."; textBox.IsReadOnly = true; textBox.Text = path; - var button = group.Button(Constants.ShowInExplorer).Button; + var button = parentLayout.Button(Constants.ShowInExplorer).Button; button.Clicked += () => FileSystem.ShowFileExplorer(Path.GetDirectoryName(path)); } }