Browse Source

EditorNode::show_warning displays a console warning instead of failing during project load

Fixes #31522
PouleyKetchoupp 6 năm trước cách đây
mục cha
commit
a735afac95
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      editor/editor_node.cpp

+ 7 - 3
editor/editor_node.cpp

@@ -3828,9 +3828,13 @@ void EditorNode::show_accept(const String &p_text, const String &p_title) {
 
 void EditorNode::show_warning(const String &p_text, const String &p_title) {
 
-	warning->set_text(p_text);
-	warning->set_title(p_title);
-	warning->popup_centered_minsize();
+	if (warning->is_inside_tree()) {
+		warning->set_text(p_text);
+		warning->set_title(p_title);
+		warning->popup_centered_minsize();
+	} else {
+		WARN_PRINTS(p_title + " " + p_text);
+	}
 }
 
 void EditorNode::_copy_warning(const String &p_str) {