summaryrefslogtreecommitdiffstats
path: root/scene/2d/cpu_particles_2d.cpp
diff options
context:
space:
mode:
authorNathan Franke <natfra@pm.me>2020-10-29 05:01:28 -0500
committerNathan Franke <natfra@pm.me>2021-04-11 23:25:38 -0500
commit2a8c59c171e609d739dcc59d15e3e205dbf47cde (patch)
treec84f0fbf2fc87ce29338f31dc4a86c7bcc0d5253 /scene/2d/cpu_particles_2d.cpp
parent4a1f2dcb746af43dcebeb241276adfb5d99c1020 (diff)
downloadredot-engine-2a8c59c171e609d739dcc59d15e3e205dbf47cde.tar.gz
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/cpu_particles_2d.cpp')
-rw-r--r--scene/2d/cpu_particles_2d.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index 6a69a4c618..5f2efeb8ca 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -244,18 +244,15 @@ bool CPUParticles2D::get_fractional_delta() const {
return fractional_delta;
}
-String CPUParticles2D::get_configuration_warning() const {
- String warnings = Node2D::get_configuration_warning();
+TypedArray<String> CPUParticles2D::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
CanvasItemMaterial *mat = Object::cast_to<CanvasItemMaterial>(get_material().ptr());
if (get_material().is_null() || (mat && !mat->get_particles_animation())) {
if (get_param(PARAM_ANIM_SPEED) != 0.0 || get_param(PARAM_ANIM_OFFSET) != 0.0 ||
get_param_curve(PARAM_ANIM_SPEED).is_valid() || get_param_curve(PARAM_ANIM_OFFSET).is_valid()) {
- if (warnings != String()) {
- warnings += "\n";
- }
- warnings += "- " + TTR("CPUParticles2D animation requires the usage of a CanvasItemMaterial with \"Particles Animation\" enabled.");
+ warnings.push_back(TTR("CPUParticles2D animation requires the usage of a CanvasItemMaterial with \"Particles Animation\" enabled."));
}
}