From 6d7f26b1f44cc16f341832b12741c7385bd1513f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Tue, 1 Aug 2023 16:45:54 +0200 Subject: [PATCH] Added "Create new Folder" to Asset Browser context menu --- GlitchyEditor/src/EditorLayer.bf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index c5e8c38..d2cb491 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -144,6 +144,14 @@ namespace GlitchyEditor private void RegisterAssetCreators() { + Editor.Instance.ContentBrowserWindow.RegisterAssetCreator(new AssetCreator("Folder", "New Folder", new (path) => + { + if (Directory.CreateDirectory(path) case .Err(let error)) + { + Log.ClientLogger.Error($"Directory \"{path}\" could not be created ({error})."); + } + })); + Editor.Instance.ContentBrowserWindow.RegisterAssetCreator(new AssetCreator("Scene", "New Scene.scene", new (path) => { using (Scene newScene = CreateNewScene())