summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-16 22:31:57 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-16 22:31:57 -0300
commitbcf27feb980aec593c7cb771984e46113cfad757 (patch)
treedabc98af627732ccf5d1bbfa8aa58348030f6324 /scene/main
parentbe4e40e90a5a322f6a7cec4893854ef5b15db600 (diff)
New Code Completion
-=-=-=-=-=-=-=-=-=- -Massive improvement to code completion -Argument hinting for functions If you manage to out-smart the code-completion in a situation where completion should be possible to guess, let me know. Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/node.cpp20
-rw-r--r--scene/main/node.h1
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; }