Basic project creation

+ Added TreeNode.RemoveChild
+ Added Directory.Copy
+ Path.Combine now replaces alt directory separator
+ Project: Renamed ProjectName to Name
+ Project.Load: Save settings, if file doesn't exist
This commit is contained in:
Simon Lübeß
2023-07-31 16:35:12 +02:00
parent 17e4a6a589
commit 0d015b485e
15 changed files with 803 additions and 41 deletions
+15 -1
View File
@@ -20,7 +20,7 @@ class Project
[BonIgnore]
private String _scriptFolder ~ delete _;
public StringView ProjectName => _projectName;
public StringView Name => _projectName;
public StringView WorkspacePath => _workspacePath;
public StringView AssetsFolder => _assetsFolder;
@@ -77,8 +77,22 @@ class Project
else
{
Log.EngineLogger.Warning($"Project file \"{settingsFile}\" doesn't exist.");
if (project.Name.IsWhiteSpace)
{
if (project._projectName == null)
project._projectName = new String();
Path.GetFileName(project.WorkspacePath, project._projectName);
Result<void> result = Bon.SerializeIntoFile(project, settingsFile);
if (result case .Err)
Log.EngineLogger.Warning($"Failed to save project file \"{settingsFile}\".");
}
}
return project;
}
}