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:
+544
-500
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@ class Project
|
|||||||
Path.Combine(target, WorkspacePath, relativePath);
|
Path.Combine(target, WorkspacePath, relativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates a new project with the given directory and name.
|
||||||
public static Project CreateNew(StringView projectDirectory, StringView projectName)
|
public static Project CreateNew(StringView projectDirectory, StringView projectName)
|
||||||
{
|
{
|
||||||
Project project = new Project(projectDirectory);
|
Project project = new Project(projectDirectory);
|
||||||
@@ -47,10 +48,14 @@ class Project
|
|||||||
String settingsFile = scope .();
|
String settingsFile = scope .();
|
||||||
project.PathInProject(settingsFile, "project.gep");
|
project.PathInProject(settingsFile, "project.gep");
|
||||||
|
|
||||||
Result<void> result = Bon.SerializeIntoFile(project, settingsFile);
|
/// This is not really fatal, however the project might end up unusable
|
||||||
|
if (Bon.SerializeIntoFile(project, settingsFile) case .Err)
|
||||||
if (result case .Err)
|
{
|
||||||
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
||||||
|
delete project;
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
@@ -75,18 +80,20 @@ class Project
|
|||||||
|
|
||||||
if (project.Name.IsWhiteSpace)
|
if (project.Name.IsWhiteSpace)
|
||||||
{
|
{
|
||||||
if (project._projectName == null)
|
project._projectName ??= new String();
|
||||||
project._projectName = new String();
|
|
||||||
|
|
||||||
Path.GetFileName(project.WorkspacePath, project._projectName);
|
Path.GetFileName(project.WorkspacePath, project._projectName);
|
||||||
|
|
||||||
Result<void> result = Bon.SerializeIntoFile(project, settingsFile);
|
/// This is not really fatal, however the project might end up unusable
|
||||||
|
if (Bon.SerializeIntoFile(project, settingsFile) case .Err)
|
||||||
if (result case .Err)
|
{
|
||||||
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
|
||||||
}
|
delete project;
|
||||||
}
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user