mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Editor Layer cleanup
This commit is contained in:
+550
-506
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@ class Project
|
||||
Path.Combine(target, WorkspacePath, relativePath);
|
||||
}
|
||||
|
||||
/// Creates a new project with the given directory and name.
|
||||
public static Project CreateNew(StringView projectDirectory, StringView projectName)
|
||||
{
|
||||
Project project = new Project(projectDirectory);
|
||||
@@ -47,10 +48,14 @@ class Project
|
||||
String settingsFile = scope .();
|
||||
project.PathInProject(settingsFile, "project.gep");
|
||||
|
||||
Result<void> result = Bon.SerializeIntoFile(project, settingsFile);
|
||||
|
||||
if (result case .Err)
|
||||
/// This is not really fatal, however the project might end up unusable
|
||||
if (Bon.SerializeIntoFile(project, settingsFile) case .Err)
|
||||
{
|
||||
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
||||
delete project;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return project;
|
||||
}
|
||||
@@ -75,19 +80,21 @@ class Project
|
||||
|
||||
if (project.Name.IsWhiteSpace)
|
||||
{
|
||||
if (project._projectName == null)
|
||||
project._projectName = new String();
|
||||
project._projectName ??= new String();
|
||||
|
||||
Path.GetFileName(project.WorkspacePath, project._projectName);
|
||||
|
||||
Result<void> result = Bon.SerializeIntoFile(project, settingsFile);
|
||||
|
||||
if (result case .Err)
|
||||
/// This is not really fatal, however the project might end up unusable
|
||||
if (Bon.SerializeIntoFile(project, settingsFile) case .Err)
|
||||
{
|
||||
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
||||
delete project;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return project;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user