summaryrefslogtreecommitdiff
path: root/scene/animation
diff options
context:
space:
mode:
authorArrowInAKnee <gatexxl@gmail.com>2020-05-14 23:59:27 +0300
committerArrowInAKnee <gatexxl@gmail.com>2020-05-16 16:07:42 +0300
commit9fc2b0fddcaeee3085e42512d7df5c39aec1368c (patch)
treeafa029449af8f9b1aba62f34467a9cc62b7b14bc /scene/animation
parent00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (diff)
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;