summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-01 14:03:29 +0200
committerGitHub <noreply@github.com>2020-10-01 14:03:29 +0200
commit12091b39d275b15a0aa93b944a670eec8b92d51b (patch)
tree46e2e9a4d1bbd93435f270b6a088287f2515e862 /scene/animation
parent23ab8ea6f62e0859313d282bc68982b05332cadb (diff)
parent9fc2b0fddcaeee3085e42512d7df5c39aec1368c (diff)
Merge pull request #38743 from arrowinaknee/node-config-warnings
Update all get_configuration_warning() to retrieve warnings from the parent
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_tree.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index 466536db10..d7d55b468e 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -1288,39 +1288,31 @@ String AnimationTree::get_configuration_warning() const {
String warning = Node::get_configuration_warning();
if (!root.is_valid()) {
- if (warning != String()) {
+ if (!warning.empty()) {
warning += "\n\n";
}
warning += TTR("No root AnimationNode for the graph is set.");
}
if (!has_node(animation_player)) {
- if (warning != String()) {
+ if (!warning.empty()) {
warning += "\n\n";
}
-
warning += TTR("Path to an AnimationPlayer node containing animations is not set.");
- return warning;
- }
-
- AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player));
-
- if (!player) {
- if (warning != String()) {
- warning += "\n\n";
- }
-
- warning += TTR("Path set for AnimationPlayer does not lead to an AnimationPlayer node.");
- return warning;
- }
+ } else {
+ AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player));
- if (!player->has_node(player->get_root())) {
- if (warning != String()) {
- warning += "\n\n";
+ if (!player) {
+ if (!warning.empty()) {
+ warning += "\n\n";
+ }
+ warning += TTR("Path set for AnimationPlayer does not lead to an AnimationPlayer node.");
+ } else if (!player->has_node(player->get_root())) {
+ if (!warning.empty()) {
+ warning += "\n\n";
+ }
+ warning += TTR("The AnimationPlayer root node is not a valid node.");
}
-
- warning += TTR("The AnimationPlayer root node is not a valid node.");
- return warning;
}
return warning;