diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/property_editor.cpp | 2 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 15 |
4 files changed, 17 insertions, 6 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index aedc96d20e..dc2eddda39 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -876,6 +876,9 @@ void ScriptEditor::_menu_option(int p_option) { bool debug_with_external_editor = !debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR)); debugger->set_debug_with_external_editor(debug_with_external_editor); debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), debug_with_external_editor); + } break; + case TOGGLE_SCRIPTS_PANEL: { + list_split->set_visible(!list_split->is_visible()); } } @@ -2235,6 +2238,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL); + file_menu->get_popup()->add_separator(); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); script_search_menu = memnew(MenuButton); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index da8248a1a7..7f17365931 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -134,6 +134,7 @@ class ScriptEditor : public VBoxContainer { FILE_CLOSE, CLOSE_DOCS, CLOSE_ALL, + TOGGLE_SCRIPTS_PANEL, FILE_TOOL_RELOAD, FILE_TOOL_RELOAD_SOFT, DEBUG_NEXT, diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ad9b3607e9..8a9fd2cde5 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -4462,7 +4462,7 @@ class SectionedPropertyEditorFilter : public Object { continue; if (sp == -1) { - pi.name = "Global/" + pi.name; + pi.name = "global/" + pi.name; } if (pi.name.begins_with(section + "/")) { diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 47675bcffe..4a9b64639b 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -58,7 +58,6 @@ void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_ file_path->set_text(""); } _lang_changed(current_language); - _template_changed(template_menu->get_selected()); _parent_name_changed(parent_name->get_text()); _class_name_changed(""); _path_changed(file_path->get_text()); @@ -246,25 +245,31 @@ void ScriptCreateDialog::_lang_changed(int l) { bool use_templates = language->is_using_templates(); template_menu->set_disabled(!use_templates); + template_menu->clear(); if (use_templates) { + template_list = EditorSettings::get_singleton()->get_script_templates(language->get_extension()); String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); String last_template = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_template", ""); - template_menu->clear(); template_menu->add_item(TTR("Default")); for (int i = 0; i < template_list.size(); i++) { String s = template_list[i].capitalize(); template_menu->add_item(s); - if (language_menu->get_item_text(l) == last_lang && last_template == s) { + if (language_menu->get_item_text(language_menu->get_selected()) == last_lang && last_template == s) { template_menu->select(i + 1); } } - _template_changed(template_menu->get_selected()); - EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_language", language_menu->get_item_text(l)); + } else { + + template_menu->add_item(TTR("N/A")); + script_template = ""; } + _template_changed(template_menu->get_selected()); + EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_language", language_menu->get_item_text(language_menu->get_selected())); + _update_dialog(); } |