Merge pull request #45113 from YeldhamDev/forgot_these_options_even_existed

Fix script list only showing their names regardless of display option
This commit is contained in:
Rémi Verschelde 2021-01-12 11:48:51 +01:00 committed by GitHub
commit 65b77a5d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -1954,7 +1954,20 @@ 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.append(sedata[j].name.replace("(*)", "").get_file()); String name = sedata[j].name.replace("(*)", "");
ScriptListName script_display = (ScriptListName)(int)EditorSettings::get_singleton()->get("text_editor/script_list/list_script_names_as");
switch (script_display) {
case DISPLAY_NAME: {
name = name.get_file();
} break;
case DISPLAY_DIR_AND_NAME: {
name = name.get_base_dir().get_file().plus_file(name.get_file());
} break;
default:
break;
}
disambiguated_script_names.append(name);
full_script_paths.append(sedata[j].tooltip); full_script_paths.append(sedata[j].tooltip);
} }