aboutsummaryrefslogtreecommitdiff
path: root/scene/2d/particles_2d.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-05-17 18:27:15 -0300
committerJuan Linietsky2016-05-17 18:28:44 -0300
commitc195c0df6b36debc870216dd42e49fbda70fa861 (patch)
tree194a26e39ace86d7a471f3e86159c2aed6be261c /scene/2d/particles_2d.cpp
parent3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff)
downloadgodot-c195c0d.tar.gz
godot-c195c0d.tar.zst
godot-c195c0d.zip
-Added configuration warning system for nodes
-Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work
Diffstat (limited to 'scene/2d/particles_2d.cpp')
-rw-r--r--scene/2d/particles_2d.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index ffea060e8..29dad630d 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -198,13 +198,21 @@ void ParticleAttractor2D::set_particles_path(NodePath p_path) {
path=p_path;
_update_owner();
+ update_configuration_warning();
}
NodePath ParticleAttractor2D::get_particles_path() const {
return path;
}
+String ParticleAttractor2D::get_configuration_warning() const {
+ if (!has_node(path) || !get_node(path) || !get_node(path)->cast_to<Particles2D>()) {
+ return TTR("Path property must point to a valid Particles2D node to work.");
+ }
+
+ return String();
+}
ParticleAttractor2D::ParticleAttractor2D() {