mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	implement generic filename disambiguation
A static function is added to EditorNode which allows for filename disambiguation given a list of filenames and the corresponding list of absolute paths for those files. This function is then used to disambiguate scene and script tabs in the editor.
This commit is contained in:
		
							parent
							
								
									bcf7e51689
								
							
						
					
					
						commit
						4285211f40
					
				
					 3 changed files with 131 additions and 1 deletions
				
			
		|  | @ -1731,6 +1731,19 @@ void ScriptEditor::_update_script_names() { | |||
| 			sedata.push_back(sd); | ||||
| 		} | ||||
| 
 | ||||
| 		Vector<String> disambiguated_script_names; | ||||
| 		Vector<String> full_script_paths; | ||||
| 		for (int j = 0; j < sedata.size(); j++) { | ||||
| 			disambiguated_script_names.append(sedata[j].name); | ||||
| 			full_script_paths.append(sedata[j].tooltip); | ||||
| 		} | ||||
| 
 | ||||
| 		EditorNode::disambiguate_filenames(full_script_paths, disambiguated_script_names); | ||||
| 
 | ||||
| 		for (int j = 0; j < sedata.size(); j++) { | ||||
| 			sedata.write[j].name = disambiguated_script_names[j]; | ||||
| 		} | ||||
| 
 | ||||
| 		EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i)); | ||||
| 		if (eh) { | ||||
| 			String name = eh->get_class(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 rileylyman
						rileylyman