diff options
author | ArrowInAKnee <gatexxl@gmail.com> | 2020-05-14 23:59:27 +0300 |
---|---|---|
committer | ArrowInAKnee <gatexxl@gmail.com> | 2020-05-16 16:07:42 +0300 |
commit | 9fc2b0fddcaeee3085e42512d7df5c39aec1368c (patch) | |
tree | afa029449af8f9b1aba62f34467a9cc62b7b14bc /scene/3d/navigation_region_3d.cpp | |
parent | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (diff) |
Update all get_configuration_warning to retrieve warnings from the parent
Diffstat (limited to 'scene/3d/navigation_region_3d.cpp')
-rw-r--r-- | scene/3d/navigation_region_3d.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp index 15ed448a65..71bc74f433 100644 --- a/scene/3d/navigation_region_3d.cpp +++ b/scene/3d/navigation_region_3d.cpp @@ -189,19 +189,26 @@ String NavigationRegion3D::get_configuration_warning() const { return String(); } + String warning = Node3D::get_configuration_warning(); + if (!navmesh.is_valid()) { - return TTR("A NavigationMesh resource must be set or created for this node to work."); + if (!warning.empty()) { + warning += "\n\n"; + } + warning += TTR("A NavigationMesh resource must be set or created for this node to work."); } const Node3D *c = this; while (c) { - if (Object::cast_to<Navigation3D>(c)) { - return String(); - } + if (Object::cast_to<Navigation3D>(c)) + return warning; c = Object::cast_to<Node3D>(c->get_parent()); } - return TTR("NavigationRegion3D must be a child or grandchild to a Navigation3D node. It only provides navigation data."); + if (!warning.empty()) { + warning += "\n\n"; + } + return warning + TTR("NavigationRegion3D must be a child or grandchild to a Navigation3D node. It only provides navigation data."); } void NavigationRegion3D::_bind_methods() { |