1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Make all get_configuration_warning() overrides retrieve warnings from parent

This commit is contained in:
ArrowInAKnee
2020-03-22 11:31:09 +03:00
parent c2a4ce9380
commit e48430b1d4
28 changed files with 249 additions and 90 deletions

View File

@@ -143,12 +143,15 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, float p_sc
}
String ParallaxLayer::get_configuration_warning() const {
String warning = Node2D::get_configuration_warning();
if (!Object::cast_to<ParallaxBackground>(get_parent())) {
return TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node.");
if (warning != String()) {
warning += "\n\n";
}
warning += TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node.");
}
return String();
return warning;
}
void ParallaxLayer::_bind_methods() {