diff options
author | Nathan Franke <natfra@pm.me> | 2020-10-29 05:01:28 -0500 |
---|---|---|
committer | Nathan Franke <natfra@pm.me> | 2021-04-11 23:25:38 -0500 |
commit | 2a8c59c171e609d739dcc59d15e3e205dbf47cde (patch) | |
tree | c84f0fbf2fc87ce29338f31dc4a86c7bcc0d5253 /scene/2d/parallax_layer.cpp | |
parent | 4a1f2dcb746af43dcebeb241276adfb5d99c1020 (diff) |
Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
Diffstat (limited to 'scene/2d/parallax_layer.cpp')
-rw-r--r-- | scene/2d/parallax_layer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 725e858a43..228020d383 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -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() { |