summaryrefslogtreecommitdiff
path: root/scene/2d/collision_object_2d.cpp
diff options
context:
space:
mode:
authorNathan Franke <natfra@pm.me>2020-10-29 05:01:28 -0500
committerNathan Franke <natfra@pm.me>2021-04-11 23:25:38 -0500
commit2a8c59c171e609d739dcc59d15e3e205dbf47cde (patch)
treec84f0fbf2fc87ce29338f31dc4a86c7bcc0d5253 /scene/2d/collision_object_2d.cpp
parent4a1f2dcb746af43dcebeb241276adfb5d99c1020 (diff)
Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
Diffstat (limited to 'scene/2d/collision_object_2d.cpp')
-rw-r--r--scene/2d/collision_object_2d.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index c83ed36917..30728a2755 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -363,17 +363,14 @@ void CollisionObject2D::_update_pickable() {
}
}
-String CollisionObject2D::get_configuration_warning() const {
- String warning = Node2D::get_configuration_warning();
+TypedArray<String> CollisionObject2D::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
if (shapes.is_empty()) {
- if (!warning.is_empty()) {
- warning += "\n\n";
- }
- warning += TTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape2D or CollisionPolygon2D as a child to define its shape.");
+ warnings.push_back(TTR("This node has no shape, so it can't collide or interact with other objects.\nConsider adding a CollisionShape2D or CollisionPolygon2D as a child to define its shape."));
}
- return warning;
+ return warnings;
}
void CollisionObject2D::_bind_methods() {