Skip to content

Commit fc960cd

Browse files
committed
Merge pull request #97013 from Hilderin/fix-load-errors-popup-empty
Fix empty load errors popup
2 parents 39115be + 430e565 commit fc960cd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

editor/editor_node.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ void EditorNode::_reload_modified_scenes() {
12021202
editor_data.set_edited_scene(i);
12031203
_remove_edited_scene(false);
12041204

1205-
Error err = load_scene(filename, false, false, true, false, true);
1205+
Error err = load_scene(filename, false, false, false, true);
12061206
if (err != OK) {
12071207
ERR_PRINT(vformat("Failed to load scene: %s", filename));
12081208
}
@@ -3931,7 +3931,7 @@ int EditorNode::new_scene() {
39313931
return idx;
39323932
}
39333933

3934-
Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, bool p_set_inherited, bool p_clear_errors, bool p_force_open_imported, bool p_silent_change_tab) {
3934+
Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, bool p_set_inherited, bool p_force_open_imported, bool p_silent_change_tab) {
39353935
if (!is_inside_tree()) {
39363936
defer_load_scene = p_scene;
39373937
return OK;
@@ -3954,10 +3954,6 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
39543954
}
39553955
}
39563956

3957-
if (p_clear_errors && !load_errors_queued_to_display) {
3958-
load_errors->clear();
3959-
}
3960-
39613957
String lpath = ProjectSettings::get_singleton()->localize_path(p_scene);
39623958

39633959
if (!lpath.begins_with("res://")) {
@@ -4935,6 +4931,12 @@ void EditorNode::_progress_dialog_visibility_changed() {
49354931
}
49364932
}
49374933

4934+
void EditorNode::_load_error_dialog_visibility_changed() {
4935+
if (!load_error_dialog->is_visible()) {
4936+
load_errors->clear();
4937+
}
4938+
}
4939+
49384940
String EditorNode::_get_system_info() const {
49394941
String distribution_name = OS::get_singleton()->get_distribution_name();
49404942
if (distribution_name.is_empty()) {
@@ -5915,7 +5917,7 @@ void EditorNode::reload_scene(const String &p_path) {
59155917

59165918
// Reload scene.
59175919
_remove_scene(scene_idx, false);
5918-
load_scene(p_path, true, false, true, true);
5920+
load_scene(p_path, true, false, true);
59195921

59205922
// Adjust index so tab is back a the previous position.
59215923
editor_data.move_edited_scene_to_index(scene_idx);
@@ -6441,7 +6443,7 @@ void EditorNode::_inherit_imported(const String &p_action) {
64416443
}
64426444

64436445
void EditorNode::_open_imported() {
6444-
load_scene(open_import_request, true, false, true, true);
6446+
load_scene(open_import_request, true, false, true);
64456447
}
64466448

64476449
void EditorNode::dim_editor(bool p_dimming) {
@@ -7848,6 +7850,7 @@ EditorNode::EditorNode() {
78487850
load_error_dialog->set_unparent_when_invisible(true);
78497851
load_error_dialog->add_child(load_errors);
78507852
load_error_dialog->set_title(TTR("Load Errors"));
7853+
load_error_dialog->connect(SceneStringName(visibility_changed), callable_mp(this, &EditorNode::_load_error_dialog_visibility_changed));
78517854

78527855
execute_outputs = memnew(RichTextLabel);
78537856
execute_outputs->set_selection_enabled(true);

editor/editor_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ class EditorNode : public Node {
660660
void _remove_all_not_owned_children(Node *p_node, Node *p_owner);
661661

662662
void _progress_dialog_visibility_changed();
663+
void _load_error_dialog_visibility_changed();
663664

664665
protected:
665666
friend class FileSystemDock;
@@ -778,7 +779,7 @@ class EditorNode : public Node {
778779

779780
void fix_dependencies(const String &p_for_file);
780781
int new_scene();
781-
Error load_scene(const String &p_scene, bool p_ignore_broken_deps = false, bool p_set_inherited = false, bool p_clear_errors = true, bool p_force_open_imported = false, bool p_silent_change_tab = false);
782+
Error load_scene(const String &p_scene, bool p_ignore_broken_deps = false, bool p_set_inherited = false, bool p_force_open_imported = false, bool p_silent_change_tab = false);
782783
Error load_resource(const String &p_resource, bool p_ignore_broken_deps = false);
783784

784785
HashMap<StringName, Variant> get_modified_properties_for_node(Node *p_node, bool p_node_references_only);

0 commit comments

Comments
 (0)