diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/code_editor.cpp | 4 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 3 | ||||
-rw-r--r-- | editor/editor_path.cpp | 9 | ||||
-rw-r--r-- | editor/editor_path.h | 1 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 2 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 10 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 28 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 15 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 46 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 7 |
12 files changed, 92 insertions, 37 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4c31797c50..1a821ddd02 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -191,7 +191,9 @@ void FindReplaceBar::_replace() { results_count = -1; } - search_current(); + if (!search_current()) { + search_next(); + } } void FindReplaceBar::_replace_all() { diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 02a9cc905b..288874d36b 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -703,6 +703,9 @@ void EditorFileDialog::update_file_list() { item_list->clear(); + // Scroll back to the top after opening a directory + item_list->get_v_scroll()->set_value(0); + if (display_mode == DISPLAY_THUMBNAILS) { item_list->set_max_columns(0); diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index f487a3048b..e4a939c379 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -132,6 +132,15 @@ void EditorPath::_id_pressed(int p_idx) { EditorNode::get_singleton()->push_item(obj); } +void EditorPath::_notification(int p_what) { + + switch (p_what) { + case NOTIFICATION_THEME_CHANGED: { + update_path(); + } break; + } +} + void EditorPath::_bind_methods() { ClassDB::bind_method("_about_to_show", &EditorPath::_about_to_show); diff --git a/editor/editor_path.h b/editor/editor_path.h index 2dc4d21f9b..a84da9f5ac 100644 --- a/editor/editor_path.h +++ b/editor/editor_path.h @@ -48,6 +48,7 @@ class EditorPath : public MenuButton { void _add_children_to_popup(Object *p_obj, int p_depth = 0); protected: + void _notification(int p_what); static void _bind_methods(); public: diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 672844117d..a3a02dbd4c 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -436,7 +436,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/indent/size", 4); hints["text_editor/indent/size"] = PropertyInfo(Variant::INT, "text_editor/indent/size", PROPERTY_HINT_RANGE, "1, 64, 1"); // size of 0 crashes. _initial_set("text_editor/indent/auto_indent", true); - _initial_set("text_editor/indent/convert_indent_on_save", false); + _initial_set("text_editor/indent/convert_indent_on_save", true); _initial_set("text_editor/indent/draw_tabs", true); _initial_set("text_editor/indent/draw_spaces", false); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 95c615afa3..f47f9b8b92 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -69,9 +69,15 @@ void ExportTemplateManager::_update_template_list() { memdelete(d); String current_version = VERSION_FULL_CONFIG; - // Downloadable export templates are only available for stable, alpha, beta and RC versions. + // Downloadable export templates are only available for stable and official alpha/beta/RC builds + // (which always have a number following their status, e.g. "alpha1"). // Therefore, don't display download-related features when using a development version - const bool downloads_available = String(VERSION_STATUS) != String("dev"); + // (whose builds aren't numbered). + const bool downloads_available = + String(VERSION_STATUS) != String("dev") && + String(VERSION_STATUS) != String("alpha") && + String(VERSION_STATUS) != String("beta") && + String(VERSION_STATUS) != String("rc"); Label *current = memnew(Label); current->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index e3f0021fbc..be05183f92 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -333,10 +333,11 @@ void FileSystemDock::_notification(int p_what) { case NOTIFICATION_DRAG_BEGIN: { Dictionary dd = get_viewport()->gui_get_drag_data(); if (tree->is_visible_in_tree() && dd.has("type")) { - if ((String(dd["type"]) == "files") || (String(dd["type"]) == "files_and_dirs") || (String(dd["type"]) == "resource")) { + if (dd.has("favorite")) { + if ((String(dd["favorite"]) == "all")) + tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); + } else if ((String(dd["type"]) == "files") || (String(dd["type"]) == "files_and_dirs") || (String(dd["type"]) == "resource")) { tree->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM | Tree::DROP_MODE_INBETWEEN); - } else if ((String(dd["type"]) == "favorite")) { - tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); } } } break; @@ -1839,7 +1840,7 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) all_not_favorites &= !is_favorite; selected = tree->get_next_selected(selected); } - if (all_favorites) { + if (!all_not_favorites) { paths = _tree_get_selected(false); } else { paths = _tree_get_selected(); @@ -1857,12 +1858,9 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) if (paths.empty()) return Variant(); - if (!all_favorites && !all_not_favorites) - return Variant(); - Dictionary drag_data = EditorNode::get_singleton()->drag_files_and_dirs(paths, p_from); - if (all_favorites) { - drag_data["type"] = "favorite"; + if (!all_not_favorites) { + drag_data["favorite"] = all_favorites ? "all" : "mixed"; } return drag_data; } @@ -1870,7 +1868,11 @@ Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) bool FileSystemDock::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { Dictionary drag_data = p_data; - if (drag_data.has("type") && String(drag_data["type"]) == "favorite") { + if (drag_data.has("favorite")) { + + if (String(drag_data["favorite"]) != "all") { + return false; + } // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); @@ -1937,7 +1939,11 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, Vector<String> dirs = EditorSettings::get_singleton()->get_favorites(); - if (drag_data.has("type") && String(drag_data["type"]) == "favorite") { + if (drag_data.has("favorite")) { + + if (String(drag_data["favorite"]) != "all") { + return; + } // Moving favorite around. TreeItem *ti = tree->get_item_at_position(p_point); if (!ti) diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index d5b1f46333..95767a96d8 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1137,9 +1137,12 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const initial_loading = false; - // The loading text only needs to be displayed before the first page is loaded + // The loading text only needs to be displayed before the first page is loaded. + // Therefore, we don't need to show it again. library_loading->hide(); + library_error->hide(); + if (asset_items) { memdelete(asset_items); } @@ -1187,6 +1190,11 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const asset_bottom_page = _make_pages(page, pages, page_len, total_items, result.size()); library_vb->add_child(asset_bottom_page); + if (result.empty()) { + library_error->set_text(vformat(TTR("No results for \"%s\"."), filter->get_text())); + library_error->show(); + } + for (int i = 0; i < result.size(); i++) { Dictionary r = result[i]; @@ -1453,6 +1461,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_loading->set_align(Label::ALIGN_CENTER); library_vb->add_child(library_loading); + library_error = memnew(Label); + library_error->set_align(Label::ALIGN_CENTER); + library_error->hide(); + library_vb->add_child(library_error); + asset_top_page = memnew(HBoxContainer); library_vb->add_child(asset_top_page); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 94289f3b49..70ffbd9eed 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -184,6 +184,7 @@ class EditorAssetLibrary : public PanelContainer { ScrollContainer *library_scroll; VBoxContainer *library_vb; Label *library_loading; + Label *library_error; LineEdit *filter; OptionButton *categories; OptionButton *repository; diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 9160920c50..727d92ba05 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -736,6 +736,9 @@ void CurveEditor::_draw() { if (_selected_point > 0 && _selected_point + 1 < curve.get_point_count()) { text_color.a *= 0.4; draw_string(font, Vector2(50, font_height), TTR("Hold Shift to edit tangents individually"), text_color); + } else if (curve.get_point_count() == 0) { + text_color.a *= 0.4; + draw_string(font, Vector2(50, font_height), TTR("Right click to add point"), text_color); } } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 5bccb36252..603a2365c1 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -967,12 +967,17 @@ void ScriptTextEditor::_update_connected_methods() { text_edit->clear_info_icons(); missing_connections.clear(); + if (!script->is_valid()) { + return; + } + Node *base = get_tree()->get_edited_scene_root(); if (!base) { return; } Vector<Node *> nodes = _find_all_node_for_script(base, base, script); + Set<StringName> methods_found; for (int i = 0; i < nodes.size(); i++) { List<Connection> connections; nodes[i]->get_signals_connected_to_this(&connections); @@ -989,28 +994,33 @@ void ScriptTextEditor::_update_connected_methods() { continue; } + if (methods_found.has(connection.method)) { + continue; + } + if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { + int line = -1; + if (script->has_method(connection.method)) { + line = script->get_member_line(connection.method); + text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); + methods_found.insert(connection.method); + continue; + } - int line = script->get_language()->find_function(connection.method, text_edit->get_text()); - if (line < 0) { - // There is a chance that the method is inherited from another script. - bool found_inherited_function = false; - Ref<Script> inherited_script = script->get_base_script(); - while (!inherited_script.is_null()) { - line = inherited_script->get_language()->find_function(connection.method, inherited_script->get_source_code()); - if (line != -1) { - found_inherited_function = true; - break; - } - - inherited_script = inherited_script->get_base_script(); + // There is a chance that the method is inherited from another script. + bool found_inherited_function = false; + Ref<Script> inherited_script = script->get_base_script(); + while (!inherited_script.is_null()) { + if (inherited_script->has_method(connection.method)) { + found_inherited_function = true; + break; } - if (!found_inherited_function) { - missing_connections.push_back(connection); - } - } else { - text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); + inherited_script = inherited_script->get_base_script(); + } + + if (!found_inherited_function) { + missing_connections.push_back(connection); } } } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 803c806028..f56f7ef7ca 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -845,9 +845,10 @@ void ProjectSettingsEditor::_item_adds(String) { void ProjectSettingsEditor::_item_add() { - // Initialize the property with the default value for the given type + // Initialize the property with the default value for the given type. + // The type list starts at 1 (as we exclude Nil), so add 1 to the selected value. Variant::CallError ce; - const Variant value = Variant::construct(Variant::Type(type->get_selected()), NULL, 0, ce); + const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), NULL, 0, ce); String catname = category->get_text().strip_edges(); String propname = property->get_text().strip_edges(); @@ -1835,7 +1836,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { // Start at 1 to avoid adding "Nil" as an option for (int i = 1; i < Variant::VARIANT_MAX; i++) { - type->add_item(Variant::get_type_name(Variant::Type(i)), i); + type->add_item(Variant::get_type_name(Variant::Type(i))); } Button *add = memnew(Button); |