diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index 877ddfd..9bc9eaa 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -75,14 +75,6 @@ namespace GlitchyEditor private float _fixedTimestep = 1.0f / 60.0f; - append List<(String Name, String Path)> _recentScenePaths = .() ~ { - for (var item in _) - { - delete item.Name; - delete item.Path; - } - }; - private GameTime _simulationGameTime = new .() ~ delete _; /// Gets or sets the path of the current scene. diff --git a/GlitchyEditor/src/Project.bf b/GlitchyEditor/src/Project.bf index c93e924..f6a0727 100644 --- a/GlitchyEditor/src/Project.bf +++ b/GlitchyEditor/src/Project.bf @@ -38,6 +38,8 @@ class Project { _workspacePath = new String(workspacePath.Length); Path.GetFullPath(workspacePath, _workspacePath); + if (_workspacePath.EndsWith(Path.DirectorySeparatorChar)) + _workspacePath.RemoveFromEnd(1); _assetsFolder = new String(); PathInProject(_assetsFolder, "Assets"); diff --git a/GlitchyEditor/src/Settings/Settings.bf b/GlitchyEditor/src/Settings/Settings.bf index 1c97019..4021d70 100644 --- a/GlitchyEditor/src/Settings/Settings.bf +++ b/GlitchyEditor/src/Settings/Settings.bf @@ -375,17 +375,25 @@ class EditorSettings if (_recentProjects == null) _recentProjects = new List(); + String absolutePath = new String(value.Length); + Path.GetFullPath(value, absolutePath); + if (absolutePath.EndsWith(Path.DirectorySeparatorChar)) + absolutePath.RemoveFromEnd(1); + // Remove duplicates for (var entry in _recentProjects) { - if (entry == value) + if (entry.EndsWith(Path.DirectorySeparatorChar)) + entry.RemoveFromEnd(1); + + if (Path.Equals(entry, absolutePath)) { delete entry; @entry.Remove(); } } - _recentProjects.Insert(0, new String(value)); + _recentProjects.Insert(0, absolutePath); if (_recentProjects.Count > 10) {