mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user