mirror of
https://github.com/godotengine/godot.git
synced 2026-01-08 00:25:01 +03:00
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
This commit is contained in:
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user