瀏覽代碼

Fix creating and updating plugin with dot in folder name

(cherry picked from commit 46253bd9e9a0ed9b8506a51bcda0472a09aa9bd5)
detomon 2 年之前
父節點
當前提交
4bc567d27a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      editor/plugin_config_dialog.cpp

+ 2 - 2
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", ""));