1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Update all get_configuration_warning to retrieve warnings from the parent

This commit is contained in:
ArrowInAKnee
2020-05-14 23:59:27 +03:00
parent 00949f0c5f
commit 9fc2b0fddc
40 changed files with 284 additions and 114 deletions

View File

@@ -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;
}
} else {
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player));
AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node(animation_player));
if (!player) {
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("Path set for AnimationPlayer does not lead to an AnimationPlayer node.");
return warning;
}
if (!player->has_node(player->get_root())) {
if (warning != String()) {
warning += "\n\n";
}
warning += TTR("The AnimationPlayer root node is not a valid node.");
return warning;
}
return warning;