瀏覽代碼

[GraphEdit] Only print warning for connection layer deletion when justified

Hendrik Brucker 11 月之前
父節點
當前提交
975e7c8ade
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      scene/gui/graph_edit.cpp

+ 3 - 1
scene/gui/graph_edit.cpp

@@ -653,7 +653,9 @@ void GraphEdit::remove_child_notify(Node *p_child) {
 		minimap = nullptr;
 	} else if (p_child == connections_layer) {
 		connections_layer = nullptr;
-		WARN_PRINT("GraphEdit's connection_layer removed. This should not be done. If you like to remove all GraphElements from a GraphEdit node, do not simply remove all non-internal children but check their type since the connection layer has to be kept non-internal due to technical reasons.");
+		if (is_inside_tree()) {
+			WARN_PRINT("GraphEdit's connection_layer removed. This should not be done. If you like to remove all GraphElements from a GraphEdit node, do not simply remove all non-internal children but check their type since the connection layer has to be kept non-internal due to technical reasons.");
+		}
 	}
 
 	if (top_layer != nullptr && is_inside_tree()) {