summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-29 13:17:17 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-29 13:17:17 +0100
commitef9cb3dfa5156901a7133ff30a46a844c4d97ce1 (patch)
treebd78f2b23e6460ad97e7c94ca8cded25fab7a267 /scene
parent8202a73c73623c51c63ff3bd70f5e44a39c59b78 (diff)
parent3e4e0f08c4fcad6453259a3d8b2ab1d8c775aa32 (diff)
downloadredot-engine-ef9cb3dfa5156901a7133ff30a46a844c4d97ce1.tar.gz
Merge pull request #87535 from Mickeon/scene-tree-configuration-warnings-cleanup
Improve appearance of Node configuration warnings
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/collision_shape_2d.cpp2
-rw-r--r--scene/main/node.cpp14
-rw-r--r--scene/main/node.h1
3 files changed, 1 insertions, 16 deletions
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index 70ec57aa7a..ee413c7bc2 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -178,7 +178,7 @@ PackedStringArray CollisionShape2D::get_configuration_warnings() const {
CollisionObject2D *col_object = Object::cast_to<CollisionObject2D>(get_parent());
if (col_object == nullptr) {
- warnings.push_back(RTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node. Please only use it as a child of Area2D, StaticBody2D, RigidBody2D, CharacterBody2D, etc. to give them a shape."));
+ warnings.push_back(RTR("CollisionShape2D only serves to provide a collision shape to a CollisionObject2D derived node.\nPlease only use it as a child of Area2D, StaticBody2D, RigidBody2D, CharacterBody2D, etc. to give them a shape."));
}
if (!shape.is_valid()) {
warnings.push_back(RTR("A shape must be provided for CollisionShape2D to function. Please create a shape resource for it!"));
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 704ff3e978..f25e178d23 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -3136,20 +3136,6 @@ PackedStringArray Node::get_configuration_warnings() const {
return ret;
}
-String Node::get_configuration_warnings_as_string() const {
- PackedStringArray warnings = get_configuration_warnings();
- String all_warnings;
- for (int i = 0; i < warnings.size(); i++) {
- if (i > 0) {
- all_warnings += "\n\n";
- }
- // Format as a bullet point list to make multiple warnings easier to distinguish
- // from each other.
- all_warnings += String::utf8("• ") + warnings[i];
- }
- return all_warnings;
-}
-
void Node::update_configuration_warnings() {
ERR_THREAD_GUARD
#ifdef TOOLS_ENABLED
diff --git a/scene/main/node.h b/scene/main/node.h
index c82300e6a0..48eae3bbfa 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -637,7 +637,6 @@ public:
_FORCE_INLINE_ Viewport *get_viewport() const { return data.viewport; }
virtual PackedStringArray get_configuration_warnings() const;
- String get_configuration_warnings_as_string() const;
void update_configuration_warnings();