summaryrefslogtreecommitdiffstats
path: root/modules/visual_script/visual_script_func_nodes.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-23 19:29:07 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-23 19:29:07 -0300
commitad8f208bdbcd9d3334c4d57d2e5554dfdb3a36d0 (patch)
tree7724895bd5694ac68e121e35b7f89824e9b61906 /modules/visual_script/visual_script_func_nodes.cpp
parent965fcf5996c734507fe548331597097e06b69ce2 (diff)
downloadredot-engine-ad8f208bdbcd9d3334c4d57d2e5554dfdb3a36d0.tar.gz
Proper function/property selection in visual script editing for property.
This one has an ordered list, built-in description, search, etc.
Diffstat (limited to 'modules/visual_script/visual_script_func_nodes.cpp')
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp662
1 files changed, 59 insertions, 603 deletions
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 14bc0bc828..12bc395474 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -372,48 +372,30 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const
}
if (property.name=="function/function") {
- property.hint=PROPERTY_HINT_ENUM;
-
-
- List<MethodInfo> methods;
if (call_mode==CALL_MODE_BASIC_TYPE) {
- if (basic_type==Variant::NIL) {
- property.usage=0;
- return; //nothing for nil
- }
- Variant::CallError ce;
- Variant v = Variant::construct(basic_type,NULL,0,ce);
- v.get_method_list(&methods);
-
-
- } else {
-
- StringName base = _get_base_type();
- ObjectTypeDB::get_method_list(base,&methods);
-
-
- }
-
- List<String> mstring;
- for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) {
- if (E->get().name.begins_with("_"))
- continue;
- mstring.push_back(E->get().name.get_slice(":",0));
- }
-
- mstring.sort();
+ property.hint=PROPERTY_HINT_METHOD_OF_VARIANT_TYPE;
+ property.hint_string=Variant::get_type_name(basic_type);
- String ml;
- for (List<String>::Element *E=mstring.front();E;E=E->next()) {
+ } else if (call_mode==CALL_MODE_SELF && get_visual_script().is_valid()) {
+ property.hint=PROPERTY_HINT_METHOD_OF_SCRIPT;
+ property.hint_string=itos(get_visual_script()->get_instance_ID());
+ } else if (call_mode==CALL_MODE_INSTANCE) {
+ property.hint=PROPERTY_HINT_METHOD_OF_BASE_TYPE;
+ property.hint_string=base_type;
+ } else if (call_mode==CALL_MODE_NODE_PATH) {
+ Node *node = _get_base_node();
+ if (node) {
+ property.hint=PROPERTY_HINT_METHOD_OF_INSTANCE;
+ property.hint_string=itos(node->get_instance_ID());
+ } else {
+ property.hint=PROPERTY_HINT_METHOD_OF_BASE_TYPE;
+ property.hint_string=get_base_type();
+ }
- if (ml!=String())
- ml+=",";
- ml+=E->get();
}
- property.hint_string=ml;
}
if (property.name=="function/use_default_args") {
@@ -472,7 +454,7 @@ void VisualScriptFunctionCall::_bind_methods() {
bt+=Variant::get_type_name(Variant::Type(i));
}
- ADD_PROPERTY(PropertyInfo(Variant::INT,"function/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type",PROPERTY_USAGE_NOEDITOR),_SCS("set_call_mode"),_SCS("get_call_mode"));
+ ADD_PROPERTY(PropertyInfo(Variant::INT,"function/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),_SCS("set_call_mode"),_SCS("get_call_mode"));
ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type"));
ADD_PROPERTY(PropertyInfo(Variant::INT,"function/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type"));
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"function/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path"));
@@ -577,7 +559,7 @@ VisualScriptNodeInstance* VisualScriptFunctionCall::instance(VisualScriptInstanc
}
VisualScriptFunctionCall::VisualScriptFunctionCall() {
- call_mode=CALL_MODE_INSTANCE;
+ call_mode=CALL_MODE_SELF;
basic_type=Variant::NIL;
use_default_args=0;
base_type="Object";
@@ -978,61 +960,30 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo& property) const {
}
if (property.name=="property/property") {
- property.hint=PROPERTY_HINT_ENUM;
-
-
- List<PropertyInfo> pinfo;
-
if (call_mode==CALL_MODE_BASIC_TYPE) {
- Variant::CallError ce;
- Variant v;
- if (basic_type==Variant::INPUT_EVENT) {
- InputEvent ev;
- ev.type=event_type;
- v=ev;
- } else {
- v = Variant::construct(basic_type,NULL,0,ce);
- }
- v.get_property_list(&pinfo);
- } else if (call_mode==CALL_MODE_NODE_PATH) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
+ property.hint_string=Variant::get_type_name(basic_type);
- Node *n = _get_base_node();
- if (n) {
- n->get_property_list(&pinfo);
+ } else if (call_mode==CALL_MODE_SELF && get_visual_script().is_valid()) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ property.hint_string=itos(get_visual_script()->get_instance_ID());
+ } else if (call_mode==CALL_MODE_INSTANCE) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ property.hint_string=base_type;
+ } else if (call_mode==CALL_MODE_NODE_PATH) {
+ Node *node = _get_base_node();
+ if (node) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_INSTANCE;
+ property.hint_string=itos(node->get_instance_ID());
} else {
- ObjectTypeDB::get_property_list(_get_base_type(),&pinfo);
+ property.hint=PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ property.hint_string=get_base_type();
}
- } else {
-
- ObjectTypeDB::get_property_list(_get_base_type(),&pinfo);
-
- }
-
- List<String> mstring;
-
- for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
-
- if (E->get().usage&PROPERTY_USAGE_EDITOR) {
- mstring.push_back(E->get().name);
- }
}
- String ml;
- for (List<String>::Element *E=mstring.front();E;E=E->next()) {
-
- if (ml!=String())
- ml+=",";
- ml+=E->get();
- }
-
- if (ml==String()) {
- property.usage=PROPERTY_USAGE_NOEDITOR; //do not show for editing if empty
- } else {
- property.hint_string=ml;
- }
}
if (property.name=="value/builtin") {
@@ -1117,7 +1068,7 @@ void VisualScriptPropertySet::_bind_methods() {
}
- ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type",PROPERTY_USAGE_NOEDITOR),_SCS("set_call_mode"),_SCS("get_call_mode"));
+ ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),_SCS("set_call_mode"),_SCS("get_call_mode"));
ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type"));
ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type"));
ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),_SCS("set_event_type"),_SCS("get_event_type"));
@@ -1250,7 +1201,7 @@ VisualScriptNodeInstance* VisualScriptPropertySet::instance(VisualScriptInstance
VisualScriptPropertySet::VisualScriptPropertySet() {
- call_mode=CALL_MODE_INSTANCE;
+ call_mode=CALL_MODE_SELF;
base_type="Object";
basic_type=Variant::NIL;
event_type=InputEvent::NONE;
@@ -1586,55 +1537,28 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo& property) const {
}
if (property.name=="property/property") {
- property.hint=PROPERTY_HINT_ENUM;
-
-
- List<PropertyInfo> pinfo;
if (call_mode==CALL_MODE_BASIC_TYPE) {
- Variant::CallError ce;
- Variant v;
- if (basic_type==Variant::INPUT_EVENT) {
- InputEvent ev;
- ev.type=event_type;
- v=ev;
- } else {
- v = Variant::construct(basic_type,NULL,0,ce);
- }
- v.get_property_list(&pinfo);
- } else if (call_mode==CALL_MODE_NODE_PATH) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
+ property.hint_string=Variant::get_type_name(basic_type);
- Node *n = _get_base_node();
- if (n) {
- n->get_property_list(&pinfo);
+ } else if (call_mode==CALL_MODE_SELF && get_visual_script().is_valid()) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ property.hint_string=itos(get_visual_script()->get_instance_ID());
+ } else if (call_mode==CALL_MODE_INSTANCE) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ property.hint_string=base_type;
+ } else if (call_mode==CALL_MODE_NODE_PATH) {
+ Node *node = _get_base_node();
+ if (node) {
+ property.hint=PROPERTY_HINT_PROPERTY_OF_INSTANCE;
+ property.hint_string=itos(node->get_instance_ID());
} else {
- ObjectTypeDB::get_property_list(_get_base_type(),&pinfo);
+ property.hint=PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ property.hint_string=get_base_type();
}
- } else {
- ObjectTypeDB::get_property_list(_get_base_type(),&pinfo);
- }
-
- List<String> mstring;
- for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
-
- if (E->get().usage&PROPERTY_USAGE_EDITOR)
- mstring.push_back(E->get().name);
- }
-
- String ml;
- for (List<String>::Element *E=mstring.front();E;E=E->next()) {
-
- if (ml!=String())
- ml+=",";
- ml+=E->get();
- }
-
- if (ml==String()) {
- property.usage=PROPERTY_USAGE_NOEDITOR; //do not show for editing if empty
- } else {
- property.hint_string=ml;
}
}
@@ -1680,7 +1604,7 @@ void VisualScriptPropertyGet::_bind_methods() {
}
- ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance",PROPERTY_USAGE_NOEDITOR),_SCS("set_call_mode"),_SCS("get_call_mode"));
+ ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance"),_SCS("set_call_mode"),_SCS("get_call_mode"));
ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type"));
ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type"));
ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),_SCS("set_event_type"),_SCS("get_event_type"));
@@ -1797,7 +1721,7 @@ VisualScriptNodeInstance* VisualScriptPropertyGet::instance(VisualScriptInstance
VisualScriptPropertyGet::VisualScriptPropertyGet() {
- call_mode=CALL_MODE_INSTANCE;
+ call_mode=CALL_MODE_SELF;
base_type="Object";
basic_type=Variant::NIL;
event_type=InputEvent::NONE;
@@ -1815,463 +1739,6 @@ static Ref<VisualScriptNode> create_property_get_node(const String& p_name) {
//////////////////////////////////////////
-////////////////SCRIPT CALL//////////////////////
-//////////////////////////////////////////
-
-int VisualScriptScriptCall::get_output_sequence_port_count() const {
-
- return 1;
-}
-
-bool VisualScriptScriptCall::has_input_sequence_port() const{
-
- return true;
-}
-
-Node *VisualScriptScriptCall::_get_base_node() const {
-
-#ifdef TOOLS_ENABLED
- Ref<Script> script = get_visual_script();
- if (!script.is_valid())
- return NULL;
-
- MainLoop * main_loop = OS::get_singleton()->get_main_loop();
- if (!main_loop)
- return NULL;
-
- SceneTree *scene_tree = main_loop->cast_to<SceneTree>();
-
- if (!scene_tree)
- return NULL;
-
- Node *edited_scene = scene_tree->get_edited_scene_root();
-
- if (!edited_scene)
- return NULL;
-
- Node* script_node = _find_script_node(edited_scene,edited_scene,script);
-
- if (!script_node)
- return NULL;
-
- if (!script_node->has_node(base_path))
- return NULL;
-
- Node *path_to = script_node->get_node(base_path);
-
- return path_to;
-#else
-
- return NULL;
-#endif
-}
-
-
-int VisualScriptScriptCall::get_input_value_port_count() const{
-
-#if 1
- return argument_count;
-#else
- if (call_mode==CALL_MODE_SELF) {
-
- Ref<VisualScript> vs = get_visual_script();
- if (vs.is_valid()) {
-
- if (!vs->has_function(function))
- return 0;
-
- int id = vs->get_function_node_id(function);
- if (id<0)
- return 0;
-
- Ref<VisualScriptFunction> func = vs->get_node(function,id);
-
- return func->get_argument_count();
- }
- } else {
-
- Node*base = _get_base_node();
- if (!base)
- return 0;
- Ref<Script> script = base->get_script();
- if (!script.is_valid())
- return 0;
-
- List<MethodInfo> functions;
- script->get_method_list(&functions);
- for (List<MethodInfo>::Element *E=functions.front();E;E=E->next()) {
- if (E->get().name==function) {
- return E->get().arguments.size();
- }
- }
-
- }
-
-
- return 0;
-#endif
-
-}
-int VisualScriptScriptCall::get_output_value_port_count() const{
- return 1;
-}
-
-String VisualScriptScriptCall::get_output_sequence_port_text(int p_port) const {
-
- return String();
-}
-
-PropertyInfo VisualScriptScriptCall::get_input_value_port_info(int p_idx) const{
-
- if (call_mode==CALL_MODE_SELF) {
-
- Ref<VisualScript> vs = get_visual_script();
- if (vs.is_valid()) {
-
- if (!vs->has_function(function))
- return PropertyInfo();
-
- int id = vs->get_function_node_id(function);
- if (id<0)
- return PropertyInfo();
-
- Ref<VisualScriptFunction> func = vs->get_node(function,id);
-
- if (p_idx>=func->get_argument_count())
- return PropertyInfo();
- return PropertyInfo(func->get_argument_type(p_idx),func->get_argument_name(p_idx));
- }
- } else {
-
- Node*base = _get_base_node();
- if (!base)
- return PropertyInfo();
- Ref<Script> script = base->get_script();
- if (!script.is_valid())
- return PropertyInfo();
-
- List<MethodInfo> functions;
- script->get_script_method_list(&functions);
- for (List<MethodInfo>::Element *E=functions.front();E;E=E->next()) {
- if (E->get().name==function) {
- if (p_idx<0 || p_idx>=E->get().arguments.size())
- return PropertyInfo();
- return E->get().arguments[p_idx];
- }
- }
-
- }
-
- return PropertyInfo();
-
-}
-
-PropertyInfo VisualScriptScriptCall::get_output_value_port_info(int p_idx) const{
-
- return PropertyInfo();
-}
-
-
-String VisualScriptScriptCall::get_caption() const {
-
- return "ScriptCall";
-}
-
-String VisualScriptScriptCall::get_text() const {
-
- return " "+String(function)+"()";
-}
-
-void VisualScriptScriptCall::_update_argument_count() {
-
- //try to remember the amount of arguments in the function, because if loaded from scratch
- //this information will not be available
-
- if (call_mode==CALL_MODE_SELF) {
-
- Ref<VisualScript> vs = get_visual_script();
- if (vs.is_valid()) {
-
- if (!vs->has_function(function))
- return ;
-
- int id = vs->get_function_node_id(function);
- if (id<0)
- return;
-
- Ref<VisualScriptFunction> func = vs->get_node(function,id);
-
- argument_count=func->get_argument_count();
- }
- } else {
-
- Node*base = _get_base_node();
- if (!base)
- return;
-
- Ref<Script> script = base->get_script();
- if (!script.is_valid())
- return ;
-
- List<MethodInfo> functions;
- script->get_method_list(&functions);
- for (List<MethodInfo>::Element *E=functions.front();E;E=E->next()) {
- if (E->get().name==function) {
- argument_count=E->get().arguments.size();
- return;
- }
- }
-
- }
-}
-
-
-void VisualScriptScriptCall::set_function(const StringName& p_type){
-
- if (function==p_type)
- return;
-
- function=p_type;
- _update_argument_count();
- _change_notify();
- ports_changed_notify();
-}
-StringName VisualScriptScriptCall::get_function() const {
-
-
- return function;
-}
-
-void VisualScriptScriptCall::set_base_path(const NodePath& p_type) {
-
- if (base_path==p_type)
- return;
-
- base_path=p_type;
- _update_argument_count();
- _change_notify();
- ports_changed_notify();
-}
-
-NodePath VisualScriptScriptCall::get_base_path() const {
-
- return base_path;
-}
-
-
-void VisualScriptScriptCall::set_call_mode(CallMode p_mode) {
-
- if (call_mode==p_mode)
- return;
-
- call_mode=p_mode;
- _update_argument_count();
- _change_notify();
- ports_changed_notify();
-
-}
-
-void VisualScriptScriptCall::set_argument_count(int p_count) {
-
- argument_count=p_count;
- _change_notify();
- ports_changed_notify();
-
-}
-
-int VisualScriptScriptCall::get_argument_count() const {
-
- return argument_count;
-}
-
-VisualScriptScriptCall::CallMode VisualScriptScriptCall::get_call_mode() const {
-
- return call_mode;
-}
-
-void VisualScriptScriptCall::_validate_property(PropertyInfo& property) const {
-
-
-
- if (property.name=="function/node_path") {
- if (call_mode!=CALL_MODE_NODE_PATH) {
- property.usage=0;
- } else {
-
- Node *bnode = _get_base_node();
- if (bnode) {
- property.hint_string=bnode->get_path(); //convert to loong string
- } else {
-
- }
- }
- }
-
- if (property.name=="function/function") {
- property.hint=PROPERTY_HINT_ENUM;
-
-
- List<MethodInfo> methods;
-
- if (call_mode==CALL_MODE_SELF) {
-
- Ref<VisualScript> vs = get_visual_script();
- if (vs.is_valid()) {
-
- vs->get_script_method_list(&methods);
-
- }
- } else {
-
- Node*base = _get_base_node();
- if (!base)
- return;
- Ref<Script> script = base->get_script();
- if (!script.is_valid())
- return;
-
- script->get_script_method_list(&methods);
-
- }
-
- List<String> mstring;
- for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) {
- if (E->get().name.begins_with("_"))
- continue;
- mstring.push_back(E->get().name.get_slice(":",0));
- }
-
- mstring.sort();
-
- String ml;
- for (List<String>::Element *E=mstring.front();E;E=E->next()) {
-
- if (ml!=String())
- ml+=",";
- ml+=E->get();
- }
-
- property.hint_string=ml;
- }
-
-}
-
-
-void VisualScriptScriptCall::_bind_methods() {
-
- ObjectTypeDB::bind_method(_MD("set_function","function"),&VisualScriptScriptCall::set_function);
- ObjectTypeDB::bind_method(_MD("get_function"),&VisualScriptScriptCall::get_function);
-
- ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptScriptCall::set_call_mode);
- ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptScriptCall::get_call_mode);
-
- ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptScriptCall::set_base_path);
- ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptScriptCall::get_base_path);
-
- ObjectTypeDB::bind_method(_MD("set_argument_count","argument_count"),&VisualScriptScriptCall::set_argument_count);
- ObjectTypeDB::bind_method(_MD("get_argument_count"),&VisualScriptScriptCall::get_argument_count);
-
- ADD_PROPERTY(PropertyInfo(Variant::INT,"function/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path"),_SCS("set_call_mode"),_SCS("get_call_mode"));
- ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"function/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path"));
- ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/function"),_SCS("set_function"),_SCS("get_function"));
- ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/argument_count"),_SCS("set_argument_count"),_SCS("get_argument_count"));
-
- BIND_CONSTANT( CALL_MODE_SELF );
- BIND_CONSTANT( CALL_MODE_NODE_PATH);
-
-}
-
-class VisualScriptNodeInstanceScriptCall : public VisualScriptNodeInstance {
-public:
-
-
- VisualScriptScriptCall::CallMode call_mode;
- NodePath node_path;
- int input_args;
- bool returns;
- StringName function;
-
- VisualScriptScriptCall *node;
- VisualScriptInstance *instance;
-
-
-
- //virtual int get_working_memory_size() const { return 0; }
- //virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
- //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
-
- virtual int step(const Variant** p_inputs,Variant** p_outputs,StartMode p_start_mode,Variant* p_working_mem,Variant::CallError& r_error,String& r_error_str) {
-
-
- switch(call_mode) {
-
- case VisualScriptScriptCall::CALL_MODE_SELF: {
-
- Object *object=instance->get_owner_ptr();
-
- *p_outputs[0] = object->call(function,p_inputs,input_args,r_error);
-
- } break;
- case VisualScriptScriptCall::CALL_MODE_NODE_PATH: {
-
- Node* node = instance->get_owner_ptr()->cast_to<Node>();
- if (!node) {
- r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD;
- r_error_str="Base object is not a Node!";
- return 0;
- }
-
- Node* another = node->get_node(node_path);
- if (!node) {
- r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD;
- r_error_str="Path does not lead Node!";
- return 0;
- }
-
-
- *p_outputs[0] = another->call(function,p_inputs,input_args,r_error);
-
- } break;
-
- }
- return 0;
-
- }
-
-
-};
-
-VisualScriptNodeInstance* VisualScriptScriptCall::instance(VisualScriptInstance* p_instance) {
-
- VisualScriptNodeInstanceScriptCall * instance = memnew(VisualScriptNodeInstanceScriptCall );
- instance->node=this;
- instance->instance=p_instance;
- instance->function=function;
- instance->call_mode=call_mode;
- instance->node_path=base_path;
- instance->input_args = argument_count;
- return instance;
-}
-
-VisualScriptScriptCall::VisualScriptScriptCall() {
-
- call_mode=CALL_MODE_SELF;
- argument_count=0;
-
-
-}
-
-template<VisualScriptScriptCall::CallMode cmode>
-static Ref<VisualScriptNode> create_script_call_node(const String& p_name) {
-
- Ref<VisualScriptScriptCall> node;
- node.instance();
- node->set_call_mode(cmode);
- return node;
-}
-
-
-//////////////////////////////////////////
////////////////EMIT//////////////////////
//////////////////////////////////////////
@@ -2475,24 +1942,13 @@ static Ref<VisualScriptNode> create_basic_type_call_node(const String& p_name) {
void register_visual_script_func_nodes() {
- VisualScriptLanguage::singleton->add_register_func("functions/call_method/call_instance",create_function_call_node<VisualScriptFunctionCall::CALL_MODE_INSTANCE>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_method/call_basic_type",create_function_call_node<VisualScriptFunctionCall::CALL_MODE_BASIC_TYPE>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_method/call_self",create_function_call_node<VisualScriptFunctionCall::CALL_MODE_SELF>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_method/call_node",create_function_call_node<VisualScriptFunctionCall::CALL_MODE_NODE_PATH>);
-
- VisualScriptLanguage::singleton->add_register_func("functions/property_set/instace_set",create_property_set_node<VisualScriptPropertySet::CALL_MODE_INSTANCE>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_set/basic_type_set",create_property_set_node<VisualScriptPropertySet::CALL_MODE_BASIC_TYPE>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_set/self_set",create_property_set_node<VisualScriptPropertySet::CALL_MODE_SELF>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_set/node_set",create_property_set_node<VisualScriptPropertySet::CALL_MODE_NODE_PATH>);
-
- VisualScriptLanguage::singleton->add_register_func("functions/property_get/instance_get",create_property_get_node<VisualScriptPropertyGet::CALL_MODE_INSTANCE>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_get/basic_type_get",create_property_get_node<VisualScriptPropertyGet::CALL_MODE_BASIC_TYPE>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_get/self_get",create_property_get_node<VisualScriptPropertyGet::CALL_MODE_SELF>);
- VisualScriptLanguage::singleton->add_register_func("functions/property_get/node_get",create_property_get_node<VisualScriptPropertyGet::CALL_MODE_NODE_PATH>);
+ VisualScriptLanguage::singleton->add_register_func("functions/call",create_node_generic<VisualScriptFunctionCall>);
+ VisualScriptLanguage::singleton->add_register_func("functions/set",create_node_generic<VisualScriptPropertySet>);
+ VisualScriptLanguage::singleton->add_register_func("functions/get",create_node_generic<VisualScriptPropertyGet>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_self",create_script_call_node<VisualScriptScriptCall::CALL_MODE_SELF>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_node",create_script_call_node<VisualScriptScriptCall::CALL_MODE_NODE_PATH>);
- VisualScriptLanguage::singleton->add_register_func("functions/call_script/emit_signal",create_node_generic<VisualScriptEmitSignal>);
+ //VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_self",create_script_call_node<VisualScriptScriptCall::CALL_MODE_SELF>);
+// VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_node",create_script_call_node<VisualScriptScriptCall::CALL_MODE_NODE_PATH>);
+ VisualScriptLanguage::singleton->add_register_func("functions/emit_signal",create_node_generic<VisualScriptEmitSignal>);
for(int i=0;i<Variant::VARIANT_MAX;i++) {