diff options
author | Anton Yabchinskiy <arn@bestmx.ru> | 2014-12-23 23:44:07 +0300 |
---|---|---|
committer | Anton Yabchinskiy <arn@bestmx.ru> | 2014-12-23 23:44:07 +0300 |
commit | 4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a (patch) | |
tree | b476b0f4aa8df1801361a04390c98cf0e2e3d98b /scene/main | |
parent | ff755f93eb86e3f7f6801918457ca77a3001671b (diff) | |
parent | 530d717a67cc3acab10270dca700db328aa12891 (diff) |
Merge branch 'master' of github.com:okamstudio/godot
Conflicts:
drivers/SCsub
platform/x11/detect.py
platform/x11/os_x11.h
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/node.cpp | 20 | ||||
-rw-r--r-- | scene/main/node.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 45a30d7bca..d9b208d6d3 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1731,6 +1731,26 @@ NodePath Node::get_import_path() const { #endif +static void _add_nodes_to_options(const Node *p_base,const Node *p_node,List<String>*r_options) { + + if (p_node!=p_base && !p_node->get_owner()) + return; + String n = p_base->get_path_to(p_node); + r_options->push_back("\""+n+"\""); + for(int i=0;i<p_node->get_child_count();i++) { + _add_nodes_to_options(p_base,p_node->get_child(i),r_options); + } +} + +void Node::get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const { + + String pf=p_function; + if ((pf=="has_node" || pf=="get_node") && p_idx==0) { + + _add_nodes_to_options(this,this,r_options); + } + Object::get_argument_options(p_function,p_idx,r_options); +} void Node::_bind_methods() { diff --git a/scene/main/node.h b/scene/main/node.h index 371a5325ca..47f49eb625 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -284,6 +284,7 @@ public: NodePath get_import_path() const; #endif + void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const; _FORCE_INLINE_ Viewport *get_viewport() const { return data.viewport; } |