From 2c5095e0a1c6e5157d20ade0a288ce6a4c6a6944 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 12 Jan 2024 20:35:59 -0600 Subject: [PATCH] Fix Plugin Project creation when the user types in symbols. --- Source/Editor/Windows/PluginsWindow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Editor/Windows/PluginsWindow.cs b/Source/Editor/Windows/PluginsWindow.cs index eb04f07b8..4145f200c 100644 --- a/Source/Editor/Windows/PluginsWindow.cs +++ b/Source/Editor/Windows/PluginsWindow.cs @@ -671,11 +671,11 @@ namespace FlaxEditor.Windows Editor.Log($"Using plugin code type name: {pluginCodeName}"); var oldPluginPath = Path.Combine(extractPath, "ExamplePlugin-master"); - var newPluginPath = Path.Combine(extractPath, pluginName); + var newPluginPath = Path.Combine(extractPath, pluginCodeName); Directory.Move(oldPluginPath, newPluginPath); var oldFlaxProjFile = Path.Combine(newPluginPath, "ExamplePlugin.flaxproj"); - var newFlaxProjFile = Path.Combine(newPluginPath, $"{pluginName}.flaxproj"); + var newFlaxProjFile = Path.Combine(newPluginPath, $"{pluginCodeName}.flaxproj"); File.Move(oldFlaxProjFile, newFlaxProjFile); var readme = Path.Combine(newPluginPath, "README.md"); @@ -687,7 +687,7 @@ namespace FlaxEditor.Windows // Flax plugin project file var flaxPluginProjContents = JsonSerializer.Deserialize(await File.ReadAllTextAsync(newFlaxProjFile)); - flaxPluginProjContents.Name = pluginName; + flaxPluginProjContents.Name = pluginCodeName; if (!string.IsNullOrEmpty(pluginVersion)) flaxPluginProjContents.Version = new Version(pluginVersion); if (!string.IsNullOrEmpty(companyName)) @@ -751,7 +751,7 @@ namespace FlaxEditor.Windows } Editor.Log($"Plugin project {pluginName} has successfully been created."); - await AddReferenceToProject(pluginName, pluginName); + await AddReferenceToProject(pluginCodeName, pluginCodeName); MessageBox.Show($"{pluginName} has been successfully created. Restart editor for changes to take effect.", "Plugin Project Created", MessageBoxButtons.OK); }