From 975a6194e75ae7cb7e52c8a83bc5b22be7a7c504 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Mon, 11 Jan 2021 18:01:21 -0300 Subject: [PATCH] Fix script list only showing their names regardless of display option (cherry picked from commit 4194447a2158e9022214b326f451f2890fa411a1) --- editor/plugins/script_editor_plugin.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 987fd44241a..8553fb9ed43 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1907,7 +1907,20 @@ void ScriptEditor::_update_script_names() { Vector disambiguated_script_names; Vector full_script_paths; for (int j = 0; j < sedata.size(); j++) { - disambiguated_script_names.push_back(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.push_back(name); full_script_paths.push_back(sedata[j].tooltip); }