From 46253bd9e9a0ed9b8506a51bcda0472a09aa9bd5 Mon Sep 17 00:00:00 2001 From: detomon Date: Mon, 4 Sep 2023 20:38:31 +0200 Subject: [PATCH] Fix creating and updating plugin with dot in folder name --- editor/plugin_config_dialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 196a2186a72..98b7ab6cc16 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -62,7 +62,7 @@ void PluginConfigDialog::_on_confirmed() { int lang_idx = script_option_edit->get_selected(); String ext = ScriptServer::get_language(lang_idx)->get_extension(); String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text(); - if (script_name.get_extension().is_empty()) { + if (script_name.get_extension() != ext) { script_name += "." + ext; } String script_path = path.path_join(script_name); @@ -152,7 +152,7 @@ void PluginConfigDialog::config(const String &p_config_path) { ERR_FAIL_COND_MSG(err != OK, "Cannot load config file from path '" + p_config_path + "'."); name_edit->set_text(cf->get_value("plugin", "name", "")); - subfolder_edit->set_text(p_config_path.get_base_dir().get_basename().get_file()); + subfolder_edit->set_text(p_config_path.get_base_dir().get_file()); desc_edit->set_text(cf->get_value("plugin", "description", "")); author_edit->set_text(cf->get_value("plugin", "author", "")); version_edit->set_text(cf->get_value("plugin", "version", ""));