From c195c0df6b36debc870216dd42e49fbda70fa861 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 17 May 2016 18:27:15 -0300 Subject: -Added configuration warning system for nodes -Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work --- scene/2d/remote_transform_2d.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scene/2d/remote_transform_2d.cpp') 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()) { + 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); -- cgit v1.2.3