diff options
Diffstat (limited to 'modules/mono/editor/GodotSharpTools')
-rw-r--r-- | modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs | 5 | ||||
-rw-r--r-- | modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs index 6a97731539..f00ec5a2ad 100644 --- a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs +++ b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs @@ -27,12 +27,15 @@ namespace GodotSharpTools.Project return false; } - public static void AddItemChecked(this ProjectRootElement root, string itemType, string include) + public static bool AddItemChecked(this ProjectRootElement root, string itemType, string include) { if (!root.HasItem(itemType, include)) { root.AddItem(itemType, include); + return true; } + + return false; } public static Guid GetGuid(this ProjectRootElement root) diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs index a50b4fb064..6889ea715f 100644 --- a/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs +++ b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs @@ -10,8 +10,8 @@ namespace GodotSharpTools.Project { var dir = Directory.GetParent(projectPath).FullName; var root = ProjectRootElement.Open(projectPath); - root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\")); - root.Save(); + if (root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\"))) + root.Save(); } } } |