summaryrefslogtreecommitdiff
path: root/scene/2d/path_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/path_2d.cpp')
-rw-r--r--scene/2d/path_2d.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index be160ee1dd..9912612c4f 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -249,21 +249,16 @@ void PathFollow2D::_validate_property(PropertyInfo &property) const {
}
}
-String PathFollow2D::get_configuration_warning() const {
- if (!is_visible_in_tree() || !is_inside_tree()) {
- return String();
- }
-
- String warning = Node2D::get_configuration_warning();
+TypedArray<String> PathFollow2D::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
- if (!Object::cast_to<Path2D>(get_parent())) {
- if (!warning.is_empty()) {
- warning += "\n\n";
+ if (is_visible_in_tree() && is_inside_tree()) {
+ if (!Object::cast_to<Path2D>(get_parent())) {
+ warnings.push_back(TTR("PathFollow2D only works when set as a child of a Path2D node."));
}
- warning += TTR("PathFollow2D only works when set as a child of a Path2D node.");
}
- return warning;
+ return warnings;
}
void PathFollow2D::_bind_methods() {