diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-05-17 18:27:15 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-05-17 18:28:44 -0300 |
commit | c195c0df6b36debc870216dd42e49fbda70fa861 (patch) | |
tree | 194a26e39ace86d7a471f3e86159c2aed6be261c /scene/2d/remote_transform_2d.cpp | |
parent | 3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff) | |
download | redot-engine-c195c0df6b36debc870216dd42e49fbda70fa861.tar.gz |
-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/remote_transform_2d.cpp')
-rw-r--r-- | scene/2d/remote_transform_2d.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 6dcd980822..4de648a1db 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -97,6 +97,8 @@ void RemoteTransform2D::set_remote_node(const NodePath& p_remote_node) { remote_node=p_remote_node; if (is_inside_tree()) _update_cache(); + + update_configuration_warning(); } NodePath RemoteTransform2D::get_remote_node() const{ @@ -105,6 +107,15 @@ NodePath RemoteTransform2D::get_remote_node() const{ } +String RemoteTransform2D::get_configuration_warning() const { + + if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Node2D>()) { + return TTR("Path property must point to a valid Node2D node to work."); + } + + return String(); +} + void RemoteTransform2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform2D::set_remote_node); |