-Added configuration warning system for nodes

-Added a new "add" and "instance" buttons for scene tree
-Added a vformat() function to ease translation work
This commit is contained in:
Juan Linietsky
2016-05-17 18:27:15 -03:00
parent 3a26e14a2b
commit c195c0df6b
63 changed files with 531 additions and 146 deletions

View File

@@ -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);