summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--editor/editor_node.h1
-rw-r--r--editor/property_editor.cpp2
-rw-r--r--editor/script_create_dialog.cpp15
4 files changed, 19 insertions, 6 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a83906ddf3..2f50842a52 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4436,6 +4436,11 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) {
}
}
+void EditorNode::_reposition_active_tab(int idx_to) {
+ editor_data.move_edited_scene_to_index(idx_to);
+ _update_scene_tabs();
+}
+
void EditorNode::_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata) {
int p_tab = p_udata.operator signed int();
if (p_preview.is_valid()) {
@@ -5025,6 +5030,7 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method("_scene_tab_hover", &EditorNode::_scene_tab_hover);
ClassDB::bind_method("_scene_tab_exit", &EditorNode::_scene_tab_exit);
ClassDB::bind_method("_scene_tab_input", &EditorNode::_scene_tab_input);
+ ClassDB::bind_method("_reposition_active_tab", &EditorNode::_reposition_active_tab);
ClassDB::bind_method("_thumbnail_done", &EditorNode::_thumbnail_done);
ClassDB::bind_method("_scene_tab_script_edited", &EditorNode::_scene_tab_script_edited);
ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state);
@@ -5399,6 +5405,7 @@ EditorNode::EditorNode() {
scene_tabs->connect("tab_hover", this, "_scene_tab_hover");
scene_tabs->connect("mouse_exited", this, "_scene_tab_exit");
scene_tabs->connect("gui_input", this, "_scene_tab_input");
+ scene_tabs->connect("reposition_active_tab_request", this, "_reposition_active_tab");
HBoxContainer *tabbar_container = memnew(HBoxContainer);
scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 49ac04243c..991cf1df71 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -572,6 +572,7 @@ private:
void _scene_tab_hover(int p_tab);
void _scene_tab_exit();
void _scene_tab_input(const Ref<InputEvent> &p_input);
+ void _reposition_active_tab(int idx_to);
void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata);
void _scene_tab_script_edited(int p_tab);
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();
}