diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_audio_buses.cpp | 6 | ||||
-rw-r--r-- | editor/editor_folding.cpp | 16 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 53 | ||||
-rw-r--r-- | editor/editor_inspector.h | 3 | ||||
-rw-r--r-- | editor/editor_node.cpp | 10 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 42 | ||||
-rw-r--r-- | editor/editor_properties.h | 3 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 2 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 60 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/packed_scene_translation_parser_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_manager.cpp | 17 | ||||
-rw-r--r-- | editor/project_manager.h | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 2 |
18 files changed, 174 insertions, 58 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 2eef4636d6..69a13957e6 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1193,7 +1193,7 @@ void EditorAudioBuses::_load_layout() { void EditorAudioBuses::_load_default_layout() { String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout"); - Ref<AudioBusLayout> state = ResourceLoader::load(layout_path, "", true); + Ref<AudioBusLayout> state = ResourceLoader::load(layout_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE); if (state.is_null()) { EditorNode::get_singleton()->show_warning(vformat(TTR("There is no '%s' file."), layout_path)); return; @@ -1209,7 +1209,7 @@ void EditorAudioBuses::_load_default_layout() { void EditorAudioBuses::_file_dialog_callback(const String &p_string) { if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_OPEN_FILE) { - Ref<AudioBusLayout> state = ResourceLoader::load(p_string, "", true); + Ref<AudioBusLayout> state = ResourceLoader::load(p_string, "", ResourceFormatLoader::CACHE_MODE_IGNORE); if (state.is_null()) { EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout.")); return; @@ -1330,7 +1330,7 @@ EditorAudioBuses::EditorAudioBuses() { void EditorAudioBuses::open_layout(const String &p_path) { EditorNode::get_singleton()->make_bottom_panel_item_visible(this); - Ref<AudioBusLayout> state = ResourceLoader::load(p_path, "", true); + Ref<AudioBusLayout> state = ResourceLoader::load(p_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE); if (state.is_null()) { EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout.")); return; diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 9f98795e16..97a2c67c26 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -259,13 +259,17 @@ void EditorFolding::_do_object_unfolds(Object *p_object, Set<RES> &resources) { } } } - } - if (E->get().type == Variant::OBJECT) { - RES res = p_object->get(E->get().name); - if (res.is_valid() && !resources.has(res) && res->get_path() != String() && !res->get_path().is_resource_file()) { - resources.insert(res); - _do_object_unfolds(res.ptr(), resources); + if (E->get().type == Variant::OBJECT) { + RES res = p_object->get(E->get().name); + print_line("res: " + String(E->get().name) + " valid " + itos(res.is_valid())); + if (res.is_valid()) { + print_line("path " + res->get_path()); + } + if (res.is_valid() && !resources.has(res) && res->get_path() != String() && !res->get_path().is_resource_file()) { + resources.insert(res); + _do_object_unfolds(res.ptr(), resources); + } } } } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 5fd03e44b9..a7f808f63a 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -81,7 +81,7 @@ Size2 EditorProperty::get_minimum_size() const { } if (bottom_editor != nullptr && bottom_editor->is_visible()) { - ms.height += get_theme_constant("vseparation", "Tree"); + ms.height += get_theme_constant("vseparation"); Size2 bems = bottom_editor->get_combined_minimum_size(); //bems.width += get_constant("item_margin", "Tree"); ms.height += bems.height; @@ -149,7 +149,7 @@ void EditorProperty::_notification(int p_what) { if (bottom_editor) { int m = 0; //get_constant("item_margin", "Tree"); - bottom_rect = Rect2(m, rect.size.height + get_theme_constant("vseparation", "Tree"), size.width - m, bottom_editor->get_combined_minimum_size().height); + bottom_rect = Rect2(m, rect.size.height + get_theme_constant("vseparation"), size.width - m, bottom_editor->get_combined_minimum_size().height); } if (keying) { @@ -226,11 +226,15 @@ void EditorProperty::_notification(int p_what) { size.height = label_reference->get_size().height; } + Ref<StyleBox> sb; if (selected) { - Ref<StyleBox> sb = get_theme_stylebox("selected", "Tree"); - draw_style_box(sb, Rect2(Vector2(), size)); + sb = get_theme_stylebox("bg_selected"); + } else { + sb = get_theme_stylebox("bg"); } + draw_style_box(sb, Rect2(Vector2(), size)); + if (draw_top_bg && right_child_rect != Rect2()) { draw_rect(right_child_rect, dark_color); } @@ -240,15 +244,15 @@ void EditorProperty::_notification(int p_what) { Color color; if (draw_red) { - color = get_theme_color("error_color", "Editor"); + color = get_theme_color("error_color"); } else { - color = get_theme_color("property_color", "Editor"); + color = get_theme_color("property_color"); } if (label.find(".") != -1) { color.a = 0.5; //this should be un-hacked honestly, as it's used for editor overrides } - int ofs = 0; + int ofs = get_theme_constant("font_offset"); int text_limit = text_size; if (checkable) { @@ -2180,17 +2184,30 @@ void EditorInspector::set_use_wide_editors(bool p_enable) { wide_editors = p_enable; } +void EditorInspector::_update_inspector_bg() { + if (sub_inspector) { + int count_subinspectors = 0; + Node *n = get_parent(); + while (n) { + EditorInspector *ei = Object::cast_to<EditorInspector>(n); + if (ei && ei->sub_inspector) { + count_subinspectors++; + } + n = n->get_parent(); + } + count_subinspectors = MIN(15, count_subinspectors); + add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg" + itos(count_subinspectors), "Editor")); + } else { + add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); + } +} void EditorInspector::set_sub_inspector(bool p_enable) { sub_inspector = p_enable; if (!is_inside_tree()) { return; } - if (sub_inspector) { - add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); - } else { - add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); - } + _update_inspector_bg(); } void EditorInspector::set_use_deletable_properties(bool p_enabled) { @@ -2418,10 +2435,8 @@ void EditorInspector::_notification(int p_what) { } if (p_what == NOTIFICATION_ENTER_TREE) { - if (sub_inspector) { - add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); - } else { - add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); + _update_inspector_bg(); + if (!sub_inspector) { get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } } @@ -2485,11 +2500,7 @@ void EditorInspector::_notification(int p_what) { } if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - if (sub_inspector) { - add_theme_style_override("bg", get_theme_stylebox("sub_inspector_bg", "Editor")); - } else if (is_inside_tree()) { - add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); - } + _update_inspector_bg(); update_tree(); } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index ad8c1611b0..b98801975f 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -343,6 +343,8 @@ class EditorInspector : public ScrollContainer { bool _is_property_disabled_by_feature_profile(const StringName &p_property); + void _update_inspector_bg(); + protected: static void _bind_methods(); void _notification(int p_what); @@ -394,6 +396,7 @@ public: void set_use_wide_editors(bool p_enable); void set_sub_inspector(bool p_enable); + bool is_sub_inspector() const { return sub_inspector; } void set_use_deletable_properties(bool p_enabled); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index e7291b014f..045480868d 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1003,7 +1003,7 @@ Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_d dependency_errors.clear(); Error err; - RES res = ResourceLoader::load(p_resource, "", false, &err); + RES res = ResourceLoader::load(p_resource, "", ResourceFormatLoader::CACHE_MODE_REUSE, &err); ERR_FAIL_COND_V(!res.is_valid(), ERR_CANT_OPEN); if (!p_ignore_broken_deps && dependency_errors.has(p_resource)) { @@ -3452,7 +3452,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b dependency_errors.clear(); Error err; - Ref<PackedScene> sdata = ResourceLoader::load(lpath, "", true, &err); + Ref<PackedScene> sdata = ResourceLoader::load(lpath, "", ResourceFormatLoader::CACHE_MODE_REPLACE, &err); if (!sdata.is_valid()) { _dialog_display_load_error(lpath, err); opening_prev = false; @@ -5274,6 +5274,8 @@ void EditorNode::_file_access_close_error_notify(const String &p_str) { } void EditorNode::reload_scene(const String &p_path) { + /* + * No longer necesary since scenes now reset and reload their internal resource if needed. //first of all, reload internal textures, materials, meshes, etc. as they might have changed on disk List<Ref<Resource>> cached; @@ -5291,6 +5293,8 @@ void EditorNode::reload_scene(const String &p_path) { to_clear.pop_front(); } + */ + int scene_idx = -1; for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { if (editor_data.get_scene_path(i) == p_path) { @@ -5854,7 +5858,7 @@ EditorNode::EditorNode() { EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false); EDITOR_DEF("interface/inspector/horizontal_vector_types_editing", true); EDITOR_DEF("interface/inspector/open_resources_in_current_inspector", true); - EDITOR_DEF("interface/inspector/resources_to_open_in_new_inspector", "StandardMaterial3D,ORMMaterial3D,Script,MeshLibrary,TileSet"); + EDITOR_DEF("interface/inspector/resources_to_open_in_new_inspector", "Script,MeshLibrary,TileSet"); EDITOR_DEF("interface/inspector/default_color_picker_mode", 0); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW", PROPERTY_USAGE_DEFAULT)); EDITOR_DEF("run/auto_save/save_before_running", true); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 669f381979..6bfc16ccd7 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2859,6 +2859,41 @@ void EditorPropertyResource::_fold_other_editors(Object *p_self) { } } +void EditorPropertyResource::_update_property_bg() { + if (!is_inside_tree()) { + return; + } + + updating_theme = true; + if (sub_inspector != nullptr) { + int count_subinspectors = 0; + Node *n = get_parent(); + while (n) { + EditorInspector *ei = Object::cast_to<EditorInspector>(n); + if (ei && ei->is_sub_inspector()) { + count_subinspectors++; + } + n = n->get_parent(); + } + count_subinspectors = MIN(15, count_subinspectors); + + add_theme_color_override("property_color", get_theme_color("sub_inspector_property_color", "Editor")); + add_theme_style_override("bg_selected", get_theme_stylebox("sub_inspector_property_bg_selected" + itos(count_subinspectors), "Editor")); + add_theme_style_override("bg", get_theme_stylebox("sub_inspector_property_bg" + itos(count_subinspectors), "Editor")); + + add_theme_constant_override("font_offset", get_theme_constant("sub_inspector_font_offset", "Editor")); + add_theme_constant_override("vseparation", 0); + } else { + add_theme_color_override("property_color", get_theme_color("property_color", "EditorProperty")); + add_theme_style_override("bg_selected", get_theme_stylebox("bg_selected", "EditorProperty")); + add_theme_style_override("bg", get_theme_stylebox("bg", "EditorProperty")); + add_theme_constant_override("vseparation", get_theme_constant("vseparation", "EditorProperty")); + add_theme_constant_override("font_offset", get_theme_constant("font_offset", "EditorProperty")); + } + + updating_theme = false; + update(); +} void EditorPropertyResource::update_property() { RES res = get_edited_object()->get(get_edited_property()); @@ -2907,6 +2942,8 @@ void EditorPropertyResource::update_property() { } opened_editor = true; } + + _update_property_bg(); } if (res.ptr() != sub_inspector->get_edited_object()) { @@ -2923,6 +2960,7 @@ void EditorPropertyResource::update_property() { EditorNode::get_singleton()->hide_top_editors(); opened_editor = false; } + _update_property_bg(); } } } @@ -2976,8 +3014,12 @@ void EditorPropertyResource::setup(const String &p_base_type) { void EditorPropertyResource::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { + if (updating_theme) { + return; + } Ref<Texture2D> t = get_theme_icon("select_arrow", "Tree"); edit->set_icon(t); + _update_property_bg(); } if (p_what == NOTIFICATION_DRAG_BEGIN) { diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 4775259111..6f097fb5df 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -654,6 +654,9 @@ class EditorPropertyResource : public EditorProperty { bool opened_editor; + bool updating_theme = false; + void _update_property_bg(); + protected: static void _bind_methods(); void _notification(int p_what); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d813ae9353..e37173bf68 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -442,6 +442,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Property editor _initial_set("docks/property_editor/auto_refresh_interval", 0.2); //update 5 times per second by default + _initial_set("docks/property_editor/subresource_hue_tint", 0.75); + hints["docks/property_editor/subresource_hue_tint"] = PropertyInfo(Variant::FLOAT, "docks/property_editor/subresource_hue_tint", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); /* Text editor */ diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 8f877a4762..f81087ded9 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -724,14 +724,58 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("visibility_xray", "PopupMenu", theme->get_icon("GuiVisibilityXray", "EditorIcons")); theme->set_constant("vseparation", "PopupMenu", (extra_spacing + default_margin_size + 1) * EDSCALE); - Ref<StyleBoxFlat> sub_inspector_bg = make_flat_stylebox(dark_color_1.lerp(accent_color, 0.08), 2, 0, 2, 2); - sub_inspector_bg->set_border_width(SIDE_LEFT, 2); - sub_inspector_bg->set_border_width(SIDE_RIGHT, 2); - sub_inspector_bg->set_border_width(SIDE_BOTTOM, 2); - sub_inspector_bg->set_border_color(accent_color * Color(1, 1, 1, 0.3)); - sub_inspector_bg->set_draw_center(true); - - theme->set_stylebox("sub_inspector_bg", "Editor", sub_inspector_bg); + for (int i = 0; i < 16; i++) { + Color si_base_color = accent_color; + + float hue_rotate = (i * 2 % 16) / 16.0; + si_base_color.set_hsv(Math::fmod(float(si_base_color.get_h() + hue_rotate), float(1.0)), si_base_color.get_s(), si_base_color.get_v()); + si_base_color = accent_color.lerp(si_base_color, float(EDITOR_GET("docks/property_editor/subresource_hue_tint"))); + + Ref<StyleBoxFlat> sub_inspector_bg; + + sub_inspector_bg = make_flat_stylebox(dark_color_1.lerp(si_base_color, 0.08), 2, 0, 2, 2); + + sub_inspector_bg->set_border_width(SIDE_LEFT, 2); + sub_inspector_bg->set_border_width(SIDE_RIGHT, 2); + sub_inspector_bg->set_border_width(SIDE_BOTTOM, 2); + sub_inspector_bg->set_border_width(SIDE_TOP, 2); + sub_inspector_bg->set_default_margin(SIDE_LEFT, 3); + sub_inspector_bg->set_default_margin(SIDE_RIGHT, 3); + sub_inspector_bg->set_default_margin(SIDE_BOTTOM, 10); + sub_inspector_bg->set_default_margin(SIDE_TOP, 5); + sub_inspector_bg->set_border_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); + sub_inspector_bg->set_draw_center(true); + + theme->set_stylebox("sub_inspector_bg" + itos(i), "Editor", sub_inspector_bg); + + Ref<StyleBoxFlat> bg_color; + bg_color.instance(); + bg_color->set_bg_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); + bg_color->set_border_width_all(0); + + Ref<StyleBoxFlat> bg_color_selected; + bg_color_selected.instance(); + bg_color_selected->set_border_width_all(0); + bg_color_selected->set_bg_color(si_base_color * Color(0.8, 0.8, 0.8, 0.8)); + + theme->set_stylebox("sub_inspector_property_bg" + itos(i), "Editor", bg_color); + theme->set_stylebox("sub_inspector_property_bg_selected" + itos(i), "Editor", bg_color_selected); + } + + theme->set_color("sub_inspector_property_color", "Editor", dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)); + theme->set_constant("sub_inspector_font_offset", "Editor", 4 * EDSCALE); + + Ref<StyleBoxFlat> style_property_bg = style_default->duplicate(); + style_property_bg->set_bg_color(highlight_color); + style_property_bg->set_border_width_all(0); + + theme->set_constant("font_offset", "EditorProperty", 1 * EDSCALE); + theme->set_stylebox("bg_selected", "EditorProperty", style_property_bg); + theme->set_stylebox("bg", "EditorProperty", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty))); + theme->set_constant("vseparation", "EditorProperty", (extra_spacing + default_margin_size) * EDSCALE); + theme->set_color("error_color", "EditorProperty", error_color); + theme->set_color("property_color", "EditorProperty", property_color); + theme->set_constant("inspector_margin", "Editor", 8 * EDSCALE); // Tree & ItemList background diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 9944712931..d0e5798045 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -964,7 +964,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String if (FileAccess::exists(ext_name) && p_keep_animations) { // Copy custom animation tracks from previously imported files. - Ref<Animation> old_anim = ResourceLoader::load(ext_name, "Animation", true); + Ref<Animation> old_anim = ResourceLoader::load(ext_name, "Animation", ResourceFormatLoader::CACHE_MODE_IGNORE); if (old_anim.is_valid()) { for (int i = 0; i < old_anim->get_track_count(); i++) { if (!old_anim->track_is_imported(i)) { @@ -1004,7 +1004,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String p_materials[mat] = ResourceLoader::load(ext_name); } else { ResourceSaver::save(ext_name, mat, ResourceSaver::FLAG_CHANGE_PATH); - p_materials[mat] = ResourceLoader::load(ext_name, "", true); // disable loading from the cache. + p_materials[mat] = ResourceLoader::load(ext_name, "", ResourceFormatLoader::CACHE_MODE_IGNORE); // disable loading from the cache. } } @@ -1061,7 +1061,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String p_materials[mat] = ResourceLoader::load(ext_name); } else { ResourceSaver::save(ext_name, mat, ResourceSaver::FLAG_CHANGE_PATH); - p_materials[mat] = ResourceLoader::load(ext_name, "", true); // disable loading from the cache. + p_materials[mat] = ResourceLoader::load(ext_name, "", ResourceFormatLoader::CACHE_MODE_IGNORE); // disable loading from the cache. } } diff --git a/editor/plugins/packed_scene_translation_parser_plugin.cpp b/editor/plugins/packed_scene_translation_parser_plugin.cpp index 1f20a87565..0a949c8610 100644 --- a/editor/plugins/packed_scene_translation_parser_plugin.cpp +++ b/editor/plugins/packed_scene_translation_parser_plugin.cpp @@ -42,7 +42,7 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path, // These properties are translated with the tr() function in the C++ code when being set or updated. Error err; - RES loaded_res = ResourceLoader::load(p_path, "PackedScene", false, &err); + RES loaded_res = ResourceLoader::load(p_path, "PackedScene", ResourceFormatLoader::CACHE_MODE_REUSE, &err); if (err) { ERR_PRINT("Failed to load " + p_path); return err; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 216c0c3bef..a6afd45686 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -894,7 +894,7 @@ void ScriptEditor::_reload_scripts() { Ref<Script> script = edited_res; if (script != nullptr) { - Ref<Script> rel_script = ResourceLoader::load(script->get_path(), script->get_class(), true); + Ref<Script> rel_script = ResourceLoader::load(script->get_path(), script->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE); ERR_CONTINUE(!rel_script.is_valid()); script->set_source_code(rel_script->get_source_code()); script->set_last_modified_time(rel_script->get_last_modified_time()); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index f57c8fbd6b..71b18497b0 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -688,7 +688,7 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo uint64_t date = FileAccess::get_modified_time(script->get_path()); if (last_date != date) { - Ref<Script> rel_script = ResourceLoader::load(script->get_path(), script->get_class(), true); + Ref<Script> rel_script = ResourceLoader::load(script->get_path(), script->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE); ERR_CONTINUE(!rel_script.is_valid()); script->set_source_code(rel_script->get_source_code()); script->set_last_modified_time(rel_script->get_last_modified_time()); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 05a1561f7d..8be82628cb 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -405,7 +405,7 @@ void ShaderEditor::_check_for_external_edit() { } void ShaderEditor::_reload_shader_from_disk() { - Ref<Shader> rel_shader = ResourceLoader::load(shader->get_path(), shader->get_class(), true); + Ref<Shader> rel_shader = ResourceLoader::load(shader->get_path(), shader->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE); ERR_FAIL_COND(!rel_shader.is_valid()); shader->set_code(rel_shader->get_code()); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index afbed0c610..4667d80057 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2015,6 +2015,10 @@ void ProjectManager::_confirm_update_settings() { } void ProjectManager::_open_selected_projects() { + // Show loading text to tell the user that the project manager is busy loading. + // This is especially important for the HTML5 project manager. + loading_label->set_modulate(Color(1, 1, 1)); + const Set<String> &selected_list = _project_list->get_selected_project_keys(); for (const Set<String>::Element *E = selected_list.front(); E; E = E->next()) { @@ -2268,11 +2272,6 @@ void ProjectManager::_restart_confirm() { get_tree()->quit(); } -void ProjectManager::_exit_dialog() { - _dim_window(); - get_tree()->quit(); -} - void ProjectManager::_install_project(const String &p_zip_path, const String &p_title) { npdialog->set_mode(ProjectDialog::MODE_INSTALL); npdialog->set_zip_path(p_zip_path); @@ -2351,7 +2350,6 @@ void ProjectManager::_on_search_term_changed(const String &p_term) { } void ProjectManager::_bind_methods() { - ClassDB::bind_method("_exit_dialog", &ProjectManager::_exit_dialog); ClassDB::bind_method("_unhandled_key_input", &ProjectManager::_unhandled_key_input); ClassDB::bind_method("_update_project_buttons", &ProjectManager::_update_project_buttons); } @@ -2481,7 +2479,12 @@ ProjectManager::ProjectManager() { search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(search_box); - hb->add_spacer(); + loading_label = memnew(Label(TTR("Loading, please wait..."))); + loading_label->add_theme_font_override("font", get_theme_font("bold", "EditorFonts")); + loading_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); + hb->add_child(loading_label); + // Hide the label but make it still take up space. This prevents reflows when showing the label. + loading_label->set_modulate(Color(0, 0, 0, 0)); Label *sort_label = memnew(Label); sort_label->set_text(TTR("Sort:")); diff --git a/editor/project_manager.h b/editor/project_manager.h index db8cb8410c..6dc0e67cba 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -54,6 +54,7 @@ class ProjectManager : public Control { ProjectList *_project_list; LineEdit *search_box; + Label *loading_label; OptionButton *filter_option; Button *run_btn; @@ -98,7 +99,6 @@ class ProjectManager : public Control { void _update_project_buttons(); void _language_selected(int p_id); void _restart_confirm(); - void _exit_dialog(); void _confirm_update_settings(); void _nonempty_confirmation_ok_pressed(); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index ac1beb1c37..11f44720da 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2841,7 +2841,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel filter->set_h_size_flags(SIZE_EXPAND_FILL); filter->set_placeholder(TTR("Filter nodes")); filter_hbc->add_child(filter); - filter->add_theme_constant_override("minimum_spaces", 0); + filter->add_theme_constant_override("minimum_character_width", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDock::_filter_changed)); button_create_script = memnew(Button); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index ce44a4bca1..2cd64a81dc 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1260,7 +1260,7 @@ SceneTreeDialog::SceneTreeDialog() { filter = memnew(LineEdit); filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter->set_placeholder(TTR("Filter nodes")); - filter->add_theme_constant_override("minimum_spaces", 0); + filter->add_theme_constant_override("minimum_character_width", 0); filter->connect("text_changed", callable_mp(this, &SceneTreeDialog::_filter_changed)); vbc->add_child(filter); |