浏览代码

Properly disambiguate unsaved scripts

(cherry picked from commit 3082def404091bce1acaa53226c514d105ddf8d1)
Tomasz Chabora 5 年之前
父节点
当前提交
cea16907bb
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      editor/plugins/script_editor_plugin.cpp

+ 6 - 2
editor/plugins/script_editor_plugin.cpp

@@ -1892,14 +1892,18 @@ void ScriptEditor::_update_script_names() {
 		Vector<String> disambiguated_script_names;
 		Vector<String> disambiguated_script_names;
 		Vector<String> full_script_paths;
 		Vector<String> full_script_paths;
 		for (int j = 0; j < sedata.size(); j++) {
 		for (int j = 0; j < sedata.size(); j++) {
-			disambiguated_script_names.push_back(sedata[j].name);
+			disambiguated_script_names.push_back(sedata[j].name.replace("(*)", ""));
 			full_script_paths.push_back(sedata[j].tooltip);
 			full_script_paths.push_back(sedata[j].tooltip);
 		}
 		}
 
 
 		EditorNode::disambiguate_filenames(full_script_paths, disambiguated_script_names);
 		EditorNode::disambiguate_filenames(full_script_paths, disambiguated_script_names);
 
 
 		for (int j = 0; j < sedata.size(); j++) {
 		for (int j = 0; j < sedata.size(); j++) {
-			sedata.write[j].name = disambiguated_script_names[j];
+			if (sedata[j].name.ends_with("(*)")) {
+				sedata.write[j].name = disambiguated_script_names[j] + "(*)";
+			} else {
+				sedata.write[j].name = disambiguated_script_names[j];
+			}
 		}
 		}
 
 
 		EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i));
 		EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i));