diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-01-11 18:01:21 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-01-11 18:01:21 -0300 |
commit | 4194447a2158e9022214b326f451f2890fa411a1 (patch) | |
tree | 9658d61b8dbdb04f639ecea9eb56ef34cfe6c9ce /editor/plugins | |
parent | 8e514bbf6ab3d2cff4daeb64e842bd8846c07046 (diff) |
Fix script list only showing their names regardless of display option
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 1af790c48d..e14aaf8aa0 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1954,7 +1954,20 @@ void ScriptEditor::_update_script_names() { 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.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); } |