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

Use Array for node configuration warnings

Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
This commit is contained in:
Nathan Franke
2020-10-29 05:01:28 -05:00
parent 4a1f2dcb74
commit 2a8c59c171
96 changed files with 426 additions and 674 deletions

View File

@@ -135,17 +135,14 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, real_t p_s
_update_mirroring();
}
String ParallaxLayer::get_configuration_warning() const {
String warning = Node2D::get_configuration_warning();
TypedArray<String> ParallaxLayer::get_configuration_warnings() const {
TypedArray<String> warnings = Node::get_configuration_warnings();
if (!Object::cast_to<ParallaxBackground>(get_parent())) {
if (!warning.is_empty()) {
warning += "\n\n";
}
warning += TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node.");
warnings.push_back(TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node."));
}
return warning;
return warnings;
}
void ParallaxLayer::_bind_methods() {