From c374d86ec78c64fbf7628565f78d51bb407f1faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Mon, 31 Jul 2023 16:40:27 +0200 Subject: [PATCH] Cleanup --- GlitchyEditor/src/EditorLayer.bf | 76 -------------------------------- GlitchyEditor/src/Project.bf | 5 --- 2 files changed, 81 deletions(-) diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index 1e941b8..322dcb6 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -674,26 +674,6 @@ namespace GlitchyEditor } } - /*var createAssetDirResult = Directory.CreateDirectory(newProject.AssetsFolder); - - if (createAssetDirResult case .Err(let error)) - { - Log.ClientLogger.Error($"Failed to create asset directory \"{newProject.AssetsFolder}\"."); - return .Err; - } - - // Copy .gitignore - String gitignoreTarget = scope .(); - newProject.PathInProject(gitignoreTarget, ".gitignore"); - var copyGitignore = File.Copy("resources/gitignore.txt", gitignoreTarget); - - if (copyGitignore case .Err(let error)) - { - Log.ClientLogger.Error($"Failed to copy .gitignore (\"{error}\")."); - } - - CreateScriptsProject(newProject);*/ - Try!(InitProject(newProject)); Try!(OpenProject(newProject)); @@ -775,61 +755,6 @@ namespace GlitchyEditor return .Ok; } - /*private static Result CreateFolderInProject(Project project, StringView directoryName) - { - String directoryPath = scope String(); - project.PathInProject(directoryPath, directoryName); - - if (Directory.CreateDirectory(directoryPath) case .Err(let error)) - { - Log.ClientLogger.Error($"Failed to create directory \"{project.AssetsFolder}\"."); - return .Err; - } - - return .Ok; - }*/ - - /*private static Result CopyAndFixupFile(Project project, StringView sourcePath, StringView targetName) - { - String fileTargetPath = scope String(); - project.PathInProject(fileTargetPath, targetName); - - if (File.Copy(sourcePath, fileTargetPath) case .Err(let error)) - { - Log.ClientLogger.Error($"Failed to copy file (\"{error}\")."); - return .Err; - } - - String fileContent = new:ScopedAlloc! String(); - - Try!(File.ReadAllText(fileTargetPath, fileContent, true)); - - fileContent.Replace("[ProjectName]", project.Name); - - String scriptCorePath = scope .(); - Directory.GetCurrentDirectory(scriptCorePath); - scriptCorePath.Append("/Resources/Scripts/ScriptCore.dll"); - fileContent.Replace("[CoreLibPath]", scriptCorePath); - - Try!(File.WriteAllText(fileTargetPath, fileContent, false)); - - return .Ok; - }*/ - - /*private Result CreateScriptsProject(Project project) - { - Try!(CreateFolderInProject(project, "Assets/Scripts")); - Try!(CreateFolderInProject(project, "Assets/Scripts/Properties")); - - Try!(CopyAndFixupFile(project, "Resources/Scripts/EmptyProject/EmptyProject.sln", scope $"Assets/Scripts/{project.Name}.sln")); - Try!(CopyAndFixupFile(project, "Resources/Scripts/EmptyProject/EmptyProject.csproj", scope $"Assets/Scripts/{project.Name}.csproj")); - Try!(CopyAndFixupFile(project, "Resources/Scripts/EmptyProject/Properties/AssemblyInfo.cs", scope $"Assets/Scripts/Properties/AssemblyInfo.cs")); - - Try!(CopyAndFixupFile(project, "Resources/Scripts/EmptyProject/.gitignore", scope $"Assets/Scripts/.gitignore")); - - return .Ok; - }*/ - private bool _openCreateProjectModal; private void ShowCreateNewProjectModal() @@ -951,7 +876,6 @@ namespace GlitchyEditor String appAssemblyPath = scope String(); _contentManager.SetAssetDirectory(_currentProject.AssetsFolder); - // TODO: obviously change dll name, configurable? Path.Combine(appAssemblyPath, _currentProject.AssetsFolder, scope $"Scripts/bin/{_currentProject.Name}.dll"); ScriptEngine.SetAppAssemblyPath(appAssemblyPath); diff --git a/GlitchyEditor/src/Project.bf b/GlitchyEditor/src/Project.bf index f2e9c35..225138f 100644 --- a/GlitchyEditor/src/Project.bf +++ b/GlitchyEditor/src/Project.bf @@ -39,11 +39,6 @@ class Project Path.Combine(target, WorkspacePath, relativePath); } - public void GetRelativePath() - { - - } - public static Project CreateNew(StringView projectDirectory, StringView projectName) { Project project = new Project(projectDirectory);