diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-02 23:03:46 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-02 23:03:46 -0300 |
commit | 118eed485e8f928a5a0dab530ae93211afa10525 (patch) | |
tree | 83efb5cbcebb7046e5b64dfe1712475a7d3b7f14 /modules | |
parent | ce26eb74bca48f16e9a34b4eb1c34e50dfc5daae (diff) |
ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant.
All usages of "type" to refer to classes were renamed to "class"
ClassDB has been exposed to GDScript.
OBJ_TYPE() macro is now GDCLASS()
Diffstat (limited to 'modules')
53 files changed, 598 insertions, 598 deletions
diff --git a/modules/chibi/event_stream_chibi.cpp b/modules/chibi/event_stream_chibi.cpp index d910d86d7b..0b680b4fda 100644 --- a/modules/chibi/event_stream_chibi.cpp +++ b/modules/chibi/event_stream_chibi.cpp @@ -860,7 +860,7 @@ void initialize_chibi() { sample_manager = memnew( CPSampleManagerImpl ); resource_loader = memnew( ResourceFormatLoaderChibi ); - ObjectTypeDB::register_type<EventStreamChibi>(); + ClassDB::register_class<EventStreamChibi>(); ResourceLoader::add_resource_format_loader( resource_loader ); } diff --git a/modules/chibi/event_stream_chibi.h b/modules/chibi/event_stream_chibi.h index 57aa307a8a..9c6c883f61 100644 --- a/modules/chibi/event_stream_chibi.h +++ b/modules/chibi/event_stream_chibi.h @@ -223,7 +223,7 @@ class EventStreamChibi; class EventStreamPlaybackChibi : public EventStreamPlayback { - OBJ_TYPE(EventStreamPlaybackChibi,EventStreamPlayback); + GDCLASS(EventStreamPlaybackChibi,EventStreamPlayback); CPMixerImpl mixer; uint64_t total_usec; @@ -275,7 +275,7 @@ public: class EventStreamChibi : public EventStream { - OBJ_TYPE(EventStreamChibi,EventStream); + GDCLASS(EventStreamChibi,EventStream); friend class ResourceFormatLoaderChibi; friend class EventStreamPlaybackChibi; diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 2fbd53d3d1..598b2aab0e 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -473,7 +473,7 @@ void ResourceFormatDDS::get_recognized_extensions(List<String> *p_extensions) co bool ResourceFormatDDS::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatDDS::get_resource_type(const String &p_path) const { diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 2ee0d8fb61..43d9988de1 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -643,12 +643,12 @@ void NetworkedMultiplayerENet::enet_compressor_destroy(void * context){ void NetworkedMultiplayerENet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("close_connection"),&NetworkedMultiplayerENet::close_connection); - ObjectTypeDB::bind_method(_MD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); - ObjectTypeDB::bind_method(_MD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); - ObjectTypeDB::bind_method(_MD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); + ClassDB::bind_method(_MD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(_MD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(_MD("close_connection"),&NetworkedMultiplayerENet::close_connection); + ClassDB::bind_method(_MD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); + ClassDB::bind_method(_MD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); + ClassDB::bind_method(_MD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); BIND_CONSTANT( COMPRESS_NONE ); BIND_CONSTANT( COMPRESS_RANGE_CODER ); diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h index 881166b7a4..dcf8c2429b 100644 --- a/modules/enet/networked_multiplayer_enet.h +++ b/modules/enet/networked_multiplayer_enet.h @@ -35,7 +35,7 @@ class NetworkedMultiplayerENet : public NetworkedMultiplayerPeer { - OBJ_TYPE(NetworkedMultiplayerENet,NetworkedMultiplayerPeer) + GDCLASS(NetworkedMultiplayerENet,NetworkedMultiplayerPeer) public: enum CompressionMode { COMPRESS_NONE, diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp index 81e3ecfd71..2b4dd35d33 100644 --- a/modules/enet/register_types.cpp +++ b/modules/enet/register_types.cpp @@ -40,7 +40,7 @@ void register_enet_types() { enet_ok=true; } - ObjectTypeDB::register_type<NetworkedMultiplayerENet>(); + ClassDB::register_class<NetworkedMultiplayerENet>(); } void unregister_enet_types() { diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp index 275afc1fd6..f8af141979 100644 --- a/modules/etc1/texture_loader_pkm.cpp +++ b/modules/etc1/texture_loader_pkm.cpp @@ -73,7 +73,7 @@ void ResourceFormatPKM::get_recognized_extensions(List<String> *p_extensions) co bool ResourceFormatPKM::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatPKM::get_resource_type(const String &p_path) const { diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 30cb09b3ba..75a49ace31 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -208,7 +208,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre if (nc) { bool success=false; - int constant = ObjectTypeDB::get_integer_constant(nc->get_name(),identifier,&success); + int constant = ClassDB::get_integer_constant(nc->get_name(),identifier,&success); if (success) { Variant key=constant; int idx; @@ -1723,7 +1723,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa } if (native.is_valid()) { - if (ObjectTypeDB::has_signal(native->get_name(),name)) { + if (ClassDB::has_signal(native->get_name(),name)) { _set_error("Signal '"+name+"' redefined (original in native class '"+String(native->get_name())+"')",p_class); return ERR_ALREADY_EXISTS; } diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index a29c5bbd8f..1a9bef6691 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -347,7 +347,7 @@ String GDScriptLanguage::make_function(const String& p_class,const String& p_nam struct GDCompletionIdentifier { - StringName obj_type; + StringName GDCLASS; Ref<GDScript> script; Variant::Type type; Variant value; //im case there is a value, also return it @@ -365,10 +365,10 @@ static GDCompletionIdentifier _get_type_from_variant(const Variant& p_variant) { Object *obj = p_variant; if (obj) { //if (obj->cast_to<GDNativeClass>()) { - // t.obj_type=obj->cast_to<GDNativeClass>()->get_name(); + // t.GDCLASS=obj->cast_to<GDNativeClass>()->get_name(); // t.value=Variant(); //} else { - t.obj_type=obj->get_type(); + t.GDCLASS=obj->get_class(); //} } } @@ -380,7 +380,7 @@ static GDCompletionIdentifier _get_type_from_pinfo(const PropertyInfo& p_info) { GDCompletionIdentifier t; t.type=p_info.type; if (p_info.hint==PROPERTY_HINT_RESOURCE_TYPE) { - t.obj_type=p_info.hint_string; + t.GDCLASS=p_info.hint_string; } return t; } @@ -508,7 +508,7 @@ static GDCompletionIdentifier _get_native_class(GDCompletionContext& context) { id.type=Variant::OBJECT; if (context.base) id.value=context.base; - id.obj_type=nc->get_name(); + id.GDCLASS=nc->get_name(); return id; } @@ -609,15 +609,15 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: GDNativeClass *gdnc = obj->cast_to<GDNativeClass>(); r_type.type=Variant::OBJECT; r_type.value=Variant(); - r_type.obj_type=gdnc->get_name(); + r_type.GDCLASS=gdnc->get_name(); return true; } } - if (ObjectTypeDB::has_method(base.obj_type,id)) { + if (ClassDB::has_method(base.GDCLASS,id)) { #ifdef TOOLS_ENABLED - MethodBind *mb = ObjectTypeDB::get_method(base.obj_type,id); + MethodBind *mb = ClassDB::get_method(base.GDCLASS,id); PropertyInfo pi = mb->get_argument_info(-1); //try calling the function if constant and all args are constant, should not crash.. @@ -643,7 +643,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: } } - if (all_valid && String(id)=="get_node" && ObjectTypeDB::is_type(base.obj_type,"Node") && args.size()) { + if (all_valid && String(id)=="get_node" && ClassDB::is_parent_class(base.GDCLASS,"Node") && args.size()) { String arg1=args[0]; if (arg1.begins_with("/root/")) { @@ -686,7 +686,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: scr = ResourceLoader::load(script); - r_type.obj_type="Node"; + r_type.GDCLASS="Node"; r_type.type=Variant::OBJECT; r_type.script=scr; r_type.value=Variant(); @@ -729,7 +729,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: r_type.type=pi.type; if (pi.hint==PROPERTY_HINT_RESOURCE_TYPE) { - r_type.obj_type=pi.hint_string; + r_type.GDCLASS=pi.hint_string; } @@ -755,7 +755,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: MethodInfo mi = E->get(); r_type.type=mi.return_val.type; if (mi.return_val.hint==PROPERTY_HINT_RESOURCE_TYPE) { - r_type.obj_type=mi.return_val.hint_string; + r_type.GDCLASS=mi.return_val.hint_string; } return true; } @@ -1064,11 +1064,11 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const if (argindex!=-1) { GDCompletionIdentifier id =_get_native_class(context); - if (id.type==Variant::OBJECT && id.obj_type!=StringName()) { + if (id.type==Variant::OBJECT && id.GDCLASS!=StringName()) { //this kinda sucks but meh List<MethodInfo> vmethods; - ObjectTypeDB::get_virtual_methods(id.obj_type,&vmethods); + ClassDB::get_virtual_methods(id.GDCLASS,&vmethods); for (List<MethodInfo>::Element *E=vmethods.front();E;E=E->next()) { @@ -1081,14 +1081,14 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const r_type.type=Variant::OBJECT; - r_type.obj_type=arg.name.substr(scp+1,arg.name.length()); + r_type.GDCLASS=arg.name.substr(scp+1,arg.name.length()); return true; } else { r_type.type=arg.type; if (arg.hint==PROPERTY_HINT_RESOURCE_TYPE) - r_type.obj_type=arg.hint_string; + r_type.GDCLASS=arg.hint_string; return true; } } @@ -1174,7 +1174,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const scr = ResourceLoader::load(script); - r_type.obj_type="Node"; + r_type.GDCLASS="Node"; r_type.type=Variant::OBJECT; r_type.script=scr; r_type.value=Variant(); @@ -1302,13 +1302,13 @@ static void _find_identifiers_in_class(GDCompletionContext& context,bool p_stati StringName type = nc->get_name(); List<String> constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List<String>::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { if (E->get().name.begins_with("_")) continue; @@ -1483,10 +1483,10 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No } - } else if (id.type==Variant::OBJECT && id.obj_type!=StringName()) { + } else if (id.type==Variant::OBJECT && id.GDCLASS!=StringName()) { - MethodBind *m = ObjectTypeDB::get_method(id.obj_type,p_method); + MethodBind *m = ClassDB::get_method(id.GDCLASS,p_method); if (!m) { //not in static method, see script @@ -1699,7 +1699,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No if (p_argidx==0) { List<MethodInfo> sigs; - ObjectTypeDB::get_signal_list(id.obj_type,&sigs); + ClassDB::get_signal_list(id.GDCLASS,&sigs); if (id.script.is_valid()) { id.script->get_script_signal_list(&sigs); @@ -1735,7 +1735,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No }*/ } else { - if (p_argidx==0 && (String(p_method)=="get_node" || String(p_method)=="has_node") && ObjectTypeDB::is_type(id.obj_type,"Node")) { + if (p_argidx==0 && (String(p_method)=="get_node" || String(p_method)=="has_node") && ClassDB::is_parent_class(id.GDCLASS,"Node")) { List<PropertyInfo> props; Globals::get_singleton()->get_property_list(&props); @@ -1962,7 +1962,7 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No GDCompletionIdentifier ci; ci.type=Variant::OBJECT; - ci.obj_type=nc->get_name(); + ci.GDCLASS=nc->get_name(); if (!context._class->owner) ci.value=context.base; @@ -1970,7 +1970,7 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No //guess type.. /* List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { //if (E->get().arguments.size()) // result.insert(E->get().name+"("); @@ -2063,13 +2063,13 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No StringName type = nc->get_name(); List<String> constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List<String>::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { if (E->get().arguments.size()) result.insert(E->get().name+"("); @@ -2143,18 +2143,18 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base GDCompletionIdentifier t; if (_guess_expression_type(context,static_cast<const GDParser::OperatorNode *>(node)->arguments[0],p.get_completion_line(),t)) { - if (t.type==Variant::OBJECT && t.obj_type=="GDNativeClass") { + if (t.type==Variant::OBJECT && t.GDCLASS=="GDNativeClass") { //native enum Ref<GDNativeClass> gdn = t.value; if (gdn.is_valid()) { StringName cn = gdn->get_name(); List<String> cnames; - ObjectTypeDB::get_integer_constant_list(cn,&cnames); + ClassDB::get_integer_constant_list(cn,&cnames); for (List<String>::Element *E=cnames.front();E;E=E->next()) { options.insert(E->get()); } } - } else if (t.type==Variant::OBJECT && t.obj_type!=StringName()) { + } else if (t.type==Variant::OBJECT && t.GDCLASS!=StringName()) { Ref<GDScript> on_script; @@ -2288,10 +2288,10 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (!isfunction) { - ObjectTypeDB::get_integer_constant_list(t.obj_type,r_options); + ClassDB::get_integer_constant_list(t.GDCLASS,r_options); } List<MethodInfo> mi; - ObjectTypeDB::get_method_list(t.obj_type,&mi); + ClassDB::get_method_list(t.GDCLASS,&mi); for (List<MethodInfo>::Element *E=mi.front();E;E=E->next()) { if (E->get().name.begins_with("_")) @@ -2395,9 +2395,9 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base GDCompletionIdentifier cid = _get_native_class(context); - if (cid.obj_type!=StringName()) { + if (cid.GDCLASS!=StringName()) { List<MethodInfo> vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.GDCLASS,&vm); for(List<MethodInfo>::Element *E=vm.front();E;E=E->next()) { MethodInfo &mi=E->get(); @@ -2430,10 +2430,10 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (!_guess_expression_type(context,node,p.get_completion_line(),t)) break; - if (t.type==Variant::OBJECT && t.obj_type!=StringName()) { + if (t.type==Variant::OBJECT && t.GDCLASS!=StringName()) { List<MethodInfo> sigs; - ObjectTypeDB::get_signal_list(t.obj_type,&sigs); + ClassDB::get_signal_list(t.GDCLASS,&sigs); for (List<MethodInfo>::Element *E=sigs.front();E;E=E->next()) { options.insert("\""+E->get().name+"\""); } @@ -2531,7 +2531,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol //before parsing, try the usual stuff - if (ObjectTypeDB::type_exists(p_symbol)) { + if (ClassDB::class_exists(p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS; r_result.class_name=p_symbol; return OK; @@ -2610,12 +2610,12 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } GDCompletionIdentifier identifier = _get_native_class(context); - print_line("identifier: "+String(identifier.obj_type)); + print_line("identifier: "+String(identifier.GDCLASS)); - if (ObjectTypeDB::has_method(identifier.obj_type,p_symbol)) { + if (ClassDB::has_method(identifier.GDCLASS,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; - r_result.class_name=identifier.obj_type; + r_result.class_name=identifier.GDCLASS; r_result.class_member=p_symbol; return OK; } @@ -2653,10 +2653,10 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol GDCompletionIdentifier identifier = _get_native_class(context); - if (ObjectTypeDB::has_method(identifier.obj_type,p_symbol)) { + if (ClassDB::has_method(identifier.GDCLASS,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; - r_result.class_name=identifier.obj_type; + r_result.class_name=identifier.GDCLASS; r_result.class_member=p_symbol; return OK; } @@ -2777,7 +2777,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } else { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS; - r_result.class_name=obj->get_type(); + r_result.class_name=obj->get_class(); } return OK; } @@ -2799,7 +2799,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol if (identifier.script.is_valid()) { print_line("var script: "+identifier.script->get_path()); } - print_line("obj type: "+String(identifier.obj_type)); + print_line("obj type: "+String(identifier.GDCLASS)); print_line("value: "+String(identifier.value)); } #endif @@ -2823,7 +2823,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol GDCompletionIdentifier t; if (_guess_expression_type(context,static_cast<const GDParser::OperatorNode *>(node)->arguments[0],p.get_completion_line(),t)) { - if (t.type==Variant::OBJECT && t.obj_type=="GDNativeClass") { + if (t.type==Variant::OBJECT && t.GDCLASS=="GDNativeClass") { //native enum Ref<GDNativeClass> gdn = t.value; if (gdn.is_valid()) { @@ -2833,7 +2833,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol return OK; } - } else if (t.type==Variant::OBJECT && t.obj_type!=StringName()) { + } else if (t.type==Variant::OBJECT && t.GDCLASS!=StringName()) { Ref<GDScript> on_script; @@ -2858,29 +2858,29 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } } - if (ObjectTypeDB::has_method(t.obj_type,p_symbol)) { + if (ClassDB::has_method(t.GDCLASS,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; - r_result.class_name=t.obj_type; + r_result.class_name=t.GDCLASS; r_result.class_member=p_symbol; return OK; } bool success; - ObjectTypeDB::get_integer_constant(t.obj_type,p_symbol,&success); + ClassDB::get_integer_constant(t.GDCLASS,p_symbol,&success); if (success) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT; - r_result.class_name=t.obj_type; + r_result.class_name=t.GDCLASS; r_result.class_member=p_symbol; return OK; } - ObjectTypeDB::get_property_type(t.obj_type,p_symbol,&success); + ClassDB::get_property_type(t.GDCLASS,p_symbol,&success); if (success) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_PROPERTY; - r_result.class_name=t.obj_type; + r_result.class_name=t.GDCLASS; r_result.class_member=p_symbol; return OK; } @@ -2934,15 +2934,15 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol GDCompletionIdentifier cid = _get_native_class(context); - if (cid.obj_type!=StringName()) { + if (cid.GDCLASS!=StringName()) { List<MethodInfo> vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.GDCLASS,&vm); for(List<MethodInfo>::Element *E=vm.front();E;E=E->next()) { if (p_symbol==E->get().name) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; - r_result.class_name=cid.obj_type; + r_result.class_name=cid.GDCLASS; r_result.class_member=p_symbol; return OK; diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 094e21bb4f..2bacb50d86 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -119,9 +119,9 @@ static String _get_var_type(const Variant* p_type) { #ifdef DEBUG_ENABLED if (ObjectDB::instance_validate(bobj)) { if (bobj->get_script_instance()) - basestr= bobj->get_type()+" ("+bobj->get_script_instance()->get_script()->get_path().get_file()+")"; + basestr= bobj->get_class()+" ("+bobj->get_script_instance()->get_script()->get_path().get_file()+")"; else - basestr = bobj->get_type(); + basestr = bobj->get_class(); } else { basestr="previously freed instance"; } @@ -395,11 +395,11 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (!nc) { - err_text="Right operand of 'extends' is not a class (type: '"+obj_B->get_type()+"')."; + err_text="Right operand of 'extends' is not a class (type: '"+obj_B->get_class()+"')."; break; } - extends_ok=ObjectTypeDB::is_type(obj_A->get_type_name(),nc->get_name()); + extends_ok=ClassDB::is_parent_class(obj_A->get_class_name(),nc->get_name()); } *dst=extends_ok; @@ -788,7 +788,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (*methodname!=GDScriptLanguage::get_singleton()->strings._init) { - MethodBind *mb = ObjectTypeDB::get_method(gds->native->get_name(),*methodname); + MethodBind *mb = ClassDB::get_method(gds->native->get_name(),*methodname); if (!mb) { err.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; } else { @@ -1435,9 +1435,9 @@ Variant GDFunctionState::resume(const Variant& p_arg) { void GDFunctionState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); + ClassDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); } diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h index f1c5b13ca1..976dbb7778 100644 --- a/modules/gdscript/gd_function.h +++ b/modules/gdscript/gd_function.h @@ -204,7 +204,7 @@ public: class GDFunctionState : public Reference { - OBJ_TYPE(GDFunctionState,Reference); + GDCLASS(GDFunctionState,Reference); friend class GDFunction; GDFunction *function; GDFunction::CallState state; diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index e5da9e7bc5..74b804b206 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -536,7 +536,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va case TYPE_EXISTS: { VALIDATE_ARG_COUNT(1); - r_ret = ObjectTypeDB::type_exists(*p_args[0]); + r_ret = ClassDB::class_exists(*p_args[0]); } break; case TEXT_CHAR: { diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 6520e27c9f..bc9d3fa4f4 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2931,7 +2931,7 @@ void GDParser::_parse_class(ClassNode *p_class) { } else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) { String identifier = tokenizer->get_token_identifier(); - if (!ObjectTypeDB::is_type(identifier,"Resource")) { + if (!ClassDB::is_parent_class(identifier,"Resource")) { current_export=PropertyInfo(); _set_error("Export hint not a type or resource."); @@ -3149,7 +3149,7 @@ void GDParser::_parse_class(ClassNode *p_class) { return; } member._export.hint=PROPERTY_HINT_RESOURCE_TYPE; - member._export.hint_string=res->get_type(); + member._export.hint_string=res->get_class(); } } } diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 39c47f7954..9c10411dcf 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -50,7 +50,7 @@ GDNativeClass::GDNativeClass(const StringName& p_name) { bool GDNativeClass::_get(const StringName& p_name,Variant &r_ret) const { bool ok; - int v = ObjectTypeDB::get_integer_constant(name, p_name, &ok); + int v = ClassDB::get_integer_constant(name, p_name, &ok); if (ok) { r_ret=v; @@ -63,7 +63,7 @@ bool GDNativeClass::_get(const StringName& p_name,Variant &r_ret) const { void GDNativeClass::_bind_methods() { - ObjectTypeDB::bind_method(_MD("new"),&GDNativeClass::_new); + ClassDB::bind_method(_MD("new"),&GDNativeClass::_new); } @@ -86,7 +86,7 @@ Variant GDNativeClass::_new() { Object *GDNativeClass::instance() { - return ObjectTypeDB::instance(name); + return ClassDB::instance(name); } @@ -388,12 +388,12 @@ ScriptInstance* GDScript::instance_create(Object *p_this) { top=top->_base; if (top->native.is_valid()) { - if (!ObjectTypeDB::is_type(p_this->get_type_name(),top->native->get_name())) { + if (!ClassDB::is_parent_class(p_this->get_class_name(),top->native->get_name())) { if (ScriptDebugger::get_singleton()) { - GDScriptLanguage::get_singleton()->debug_break_parse(get_path(),0,"Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_type()+"'"); + GDScriptLanguage::get_singleton()->debug_break_parse(get_path(),0,"Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_class()+"'"); } - ERR_EXPLAIN("Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_type()+"'"); + ERR_EXPLAIN("Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_class()+"'"); ERR_FAIL_V(NULL); } @@ -751,9 +751,9 @@ void GDScript::_get_property_list(List<PropertyInfo> *p_properties) const { void GDScript::_bind_methods() { - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo(Variant::OBJECT,"new")); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo(Variant::OBJECT,"new")); - ObjectTypeDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); + ClassDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); } @@ -1477,7 +1477,7 @@ void GDScriptLanguage::init() { //populate native classes List<StringName> class_list; - ObjectTypeDB::get_type_list(&class_list); + ClassDB::get_class_list(&class_list); for(List<StringName>::Element *E=class_list.front();E;E=E->next()) { StringName n = E->get(); diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 9903c7a79e..7e572589c7 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -35,7 +35,7 @@ #include "gd_function.h" class GDNativeClass : public Reference { - OBJ_TYPE(GDNativeClass,Reference); + GDCLASS(GDNativeClass,Reference); StringName name; protected: @@ -55,7 +55,7 @@ public: class GDScript : public Script { - OBJ_TYPE(GDScript,Script); + GDCLASS(GDScript,Script); bool tool; bool valid; diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 3292c094e4..11bdf783f8 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -48,7 +48,7 @@ ResourceFormatSaverGDScript *resource_saver_gd=NULL; class EditorExportGDScript : public EditorExportPlugin { - OBJ_TYPE(EditorExportGDScript,EditorExportPlugin); + GDCLASS(EditorExportGDScript,EditorExportPlugin); public: @@ -138,8 +138,8 @@ static void register_editor_plugin() { void register_gdscript_types() { - ObjectTypeDB::register_type<GDScript>(); - ObjectTypeDB::register_virtual_type<GDFunctionState>(); + ClassDB::register_class<GDScript>(); + ClassDB::register_virtual_class<GDFunctionState>(); script_language_gd=memnew( GDScriptLanguage ); //script_language_gd->init(); diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index b7c18ba477..84d8250033 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -1185,60 +1185,60 @@ void GridMap::_update_dirty_map_callback() { void GridMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); - ObjectTypeDB::bind_method(_MD("get_theme:MeshLibrary"),&GridMap::get_theme); + ClassDB::bind_method(_MD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); + ClassDB::bind_method(_MD("get_theme:MeshLibrary"),&GridMap::get_theme); - ObjectTypeDB::bind_method(_MD("set_bake","enable"),&GridMap::set_bake); - ObjectTypeDB::bind_method(_MD("is_baking_enabled"),&GridMap::is_baking_enabled); + ClassDB::bind_method(_MD("set_bake","enable"),&GridMap::set_bake); + ClassDB::bind_method(_MD("is_baking_enabled"),&GridMap::is_baking_enabled); - ObjectTypeDB::bind_method(_MD("set_cell_size","size"),&GridMap::set_cell_size); - ObjectTypeDB::bind_method(_MD("get_cell_size"),&GridMap::get_cell_size); + ClassDB::bind_method(_MD("set_cell_size","size"),&GridMap::set_cell_size); + ClassDB::bind_method(_MD("get_cell_size"),&GridMap::get_cell_size); - ObjectTypeDB::bind_method(_MD("set_octant_size","size"),&GridMap::set_octant_size); - ObjectTypeDB::bind_method(_MD("get_octant_size"),&GridMap::get_octant_size); + ClassDB::bind_method(_MD("set_octant_size","size"),&GridMap::set_octant_size); + ClassDB::bind_method(_MD("get_octant_size"),&GridMap::get_octant_size); - ObjectTypeDB::bind_method(_MD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); - ObjectTypeDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); + ClassDB::bind_method(_MD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); + ClassDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); + ClassDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); -// ObjectTypeDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); - ObjectTypeDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); - ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); +// ClassDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); + ClassDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); + ClassDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); - ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); - ObjectTypeDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); - ObjectTypeDB::bind_method(_MD("set_center_y","enable"),&GridMap::set_center_y); - ObjectTypeDB::bind_method(_MD("get_center_y"),&GridMap::get_center_y); - ObjectTypeDB::bind_method(_MD("set_center_z","enable"),&GridMap::set_center_z); - ObjectTypeDB::bind_method(_MD("get_center_z"),&GridMap::get_center_z); + ClassDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); + ClassDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); + ClassDB::bind_method(_MD("set_center_y","enable"),&GridMap::set_center_y); + ClassDB::bind_method(_MD("get_center_y"),&GridMap::get_center_y); + ClassDB::bind_method(_MD("set_center_z","enable"),&GridMap::set_center_z); + ClassDB::bind_method(_MD("get_center_z"),&GridMap::get_center_z); - ObjectTypeDB::bind_method(_MD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); + ClassDB::bind_method(_MD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); - ObjectTypeDB::bind_method(_MD("create_area","id","area"),&GridMap::create_area); - ObjectTypeDB::bind_method(_MD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); - ObjectTypeDB::bind_method(_MD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); - ObjectTypeDB::bind_method(_MD("area_set_name","area","name"),&GridMap::area_set_name); - ObjectTypeDB::bind_method(_MD("area_get_name","area"),&GridMap::area_get_name); - ObjectTypeDB::bind_method(_MD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); - ObjectTypeDB::bind_method(_MD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); - ObjectTypeDB::bind_method(_MD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); - ObjectTypeDB::bind_method(_MD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); - ObjectTypeDB::bind_method(_MD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); - ObjectTypeDB::bind_method(_MD("erase_area","area"),&GridMap::erase_area); - ObjectTypeDB::bind_method(_MD("get_unused_area_id","area"),&GridMap::get_unused_area_id); - ObjectTypeDB::bind_method(_MD("bake_geometry"),&GridMap::bake_geometry); + ClassDB::bind_method(_MD("create_area","id","area"),&GridMap::create_area); + ClassDB::bind_method(_MD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); + ClassDB::bind_method(_MD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); + ClassDB::bind_method(_MD("area_set_name","area","name"),&GridMap::area_set_name); + ClassDB::bind_method(_MD("area_get_name","area"),&GridMap::area_get_name); + ClassDB::bind_method(_MD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); + ClassDB::bind_method(_MD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); + ClassDB::bind_method(_MD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); + ClassDB::bind_method(_MD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); + ClassDB::bind_method(_MD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); + ClassDB::bind_method(_MD("erase_area","area"),&GridMap::erase_area); + ClassDB::bind_method(_MD("get_unused_area_id","area"),&GridMap::get_unused_area_id); + ClassDB::bind_method(_MD("bake_geometry"),&GridMap::bake_geometry); - ObjectTypeDB::bind_method(_MD("_baked_light_changed"),&GridMap::_baked_light_changed); - ObjectTypeDB::bind_method(_MD("set_use_baked_light","use"),&GridMap::set_use_baked_light); - ObjectTypeDB::bind_method(_MD("is_using_baked_light","use"),&GridMap::is_using_baked_light); + ClassDB::bind_method(_MD("_baked_light_changed"),&GridMap::_baked_light_changed); + ClassDB::bind_method(_MD("set_use_baked_light","use"),&GridMap::set_use_baked_light); + ClassDB::bind_method(_MD("is_using_baked_light","use"),&GridMap::is_using_baked_light); - ObjectTypeDB::bind_method(_MD("_get_baked_light_meshes"),&GridMap::_get_baked_light_meshes); + ClassDB::bind_method(_MD("_get_baked_light_meshes"),&GridMap::_get_baked_light_meshes); - ObjectTypeDB::set_method_flags("GridMap","bake_geometry",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags("GridMap","bake_geometry",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("clear"),&GridMap::clear); + ClassDB::bind_method(_MD("clear"),&GridMap::clear); BIND_CONSTANT( INVALID_CELL_ITEM ); diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 3863c337b3..934e9382b3 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -44,7 +44,7 @@ class BakedLightInstance; class GridMap : public Spatial { - OBJ_TYPE( GridMap, Spatial ); + GDCLASS( GridMap, Spatial ); enum { MAP_DIRTY_TRANSFORMS=1, diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 246f2eecc9..eb712e49cb 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1181,15 +1181,15 @@ void GridMapEditor::_floor_changed(float p_value) { void GridMapEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&GridMapEditor::_menu_option); - ObjectTypeDB::bind_method("_configure",&GridMapEditor::_configure); - ObjectTypeDB::bind_method("_item_selected_cbk",&GridMapEditor::_item_selected_cbk); - ObjectTypeDB::bind_method("_edit_mode_changed",&GridMapEditor::_edit_mode_changed); - ObjectTypeDB::bind_method("_area_renamed",&GridMapEditor::_area_renamed); - ObjectTypeDB::bind_method("_area_selected",&GridMapEditor::_area_selected); - ObjectTypeDB::bind_method("_floor_changed",&GridMapEditor::_floor_changed); - - ObjectTypeDB::bind_method(_MD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); + ClassDB::bind_method("_menu_option",&GridMapEditor::_menu_option); + ClassDB::bind_method("_configure",&GridMapEditor::_configure); + ClassDB::bind_method("_item_selected_cbk",&GridMapEditor::_item_selected_cbk); + ClassDB::bind_method("_edit_mode_changed",&GridMapEditor::_edit_mode_changed); + ClassDB::bind_method("_area_renamed",&GridMapEditor::_area_renamed); + ClassDB::bind_method("_area_selected",&GridMapEditor::_area_selected); + ClassDB::bind_method("_floor_changed",&GridMapEditor::_floor_changed); + + ClassDB::bind_method(_MD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); } @@ -1480,7 +1480,7 @@ void GridMapEditorPlugin::edit(Object *p_object) { bool GridMapEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("GridMap"); + return p_object->is_class("GridMap"); } void GridMapEditorPlugin::make_visible(bool p_visible) { diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 34ced7b13b..2c0ff99dc6 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -40,7 +40,7 @@ class SpatialEditorPlugin; class GridMapEditor : public VBoxContainer { - OBJ_TYPE(GridMapEditor, VBoxContainer ); + GDCLASS(GridMapEditor, VBoxContainer ); enum { @@ -238,7 +238,7 @@ public: class GridMapEditorPlugin : public EditorPlugin { - OBJ_TYPE( GridMapEditorPlugin, EditorPlugin ); + GDCLASS( GridMapEditorPlugin, EditorPlugin ); GridMapEditor *gridmap_editor; EditorNode *editor; diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp index 284d59a689..b4a0d3b0b7 100644 --- a/modules/gridmap/register_types.cpp +++ b/modules/gridmap/register_types.cpp @@ -36,7 +36,7 @@ void register_gridmap_types() { #ifndef _3D_DISABLED - ObjectTypeDB::register_type<GridMap>(); + ClassDB::register_class<GridMap>(); #ifdef TOOLS_ENABLED EditorPlugins::add_by_type<GridMapEditorPlugin>(); #endif diff --git a/modules/mpc/audio_stream_mpc.cpp b/modules/mpc/audio_stream_mpc.cpp index befb8ea291..d8572d3b5d 100644 --- a/modules/mpc/audio_stream_mpc.cpp +++ b/modules/mpc/audio_stream_mpc.cpp @@ -351,8 +351,8 @@ void AudioStreamPlaybackMPC::seek_pos(float p_time) { void AudioStreamPlaybackMPC::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_file","name"),&AudioStreamPlaybackMPC::set_file); - ObjectTypeDB::bind_method(_MD("get_file"),&AudioStreamPlaybackMPC::get_file); + ClassDB::bind_method(_MD("set_file","name"),&AudioStreamPlaybackMPC::set_file); + ClassDB::bind_method(_MD("get_file"),&AudioStreamPlaybackMPC::get_file); ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"file",PROPERTY_HINT_FILE,"mpc"), _SCS("set_file"), _SCS("get_file")); diff --git a/modules/mpc/audio_stream_mpc.h b/modules/mpc/audio_stream_mpc.h index 9430f752ff..e7d677aa8c 100644 --- a/modules/mpc/audio_stream_mpc.h +++ b/modules/mpc/audio_stream_mpc.h @@ -38,7 +38,7 @@ class AudioStreamPlaybackMPC : public AudioStreamPlayback { - OBJ_TYPE( AudioStreamPlaybackMPC, AudioStreamPlayback ); + GDCLASS( AudioStreamPlaybackMPC, AudioStreamPlayback ); bool preload; FileAccess *f; @@ -118,7 +118,7 @@ public: class AudioStreamMPC : public AudioStream { - OBJ_TYPE( AudioStreamMPC, AudioStream ); + GDCLASS( AudioStreamMPC, AudioStream ); String file; public: diff --git a/modules/mpc/register_types.cpp b/modules/mpc/register_types.cpp index 7e962804b5..df058916bb 100644 --- a/modules/mpc/register_types.cpp +++ b/modules/mpc/register_types.cpp @@ -36,7 +36,7 @@ void register_mpc_types() { mpc_stream_loader=memnew( ResourceFormatLoaderAudioStreamMPC ); ResourceLoader::add_resource_format_loader(mpc_stream_loader); - ObjectTypeDB::register_type<AudioStreamMPC>(); + ClassDB::register_class<AudioStreamMPC>(); } void unregister_mpc_types() { diff --git a/modules/openssl/register_types.cpp b/modules/openssl/register_types.cpp index e92d9a8c7b..6cc9fa3669 100644 --- a/modules/openssl/register_types.cpp +++ b/modules/openssl/register_types.cpp @@ -32,7 +32,7 @@ void register_openssl_types() { - ObjectTypeDB::register_type<StreamPeerOpenSSL>(); + ClassDB::register_class<StreamPeerOpenSSL>(); StreamPeerOpenSSL::initialize_ssl(); } diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h index 68e15f188b..5093456ccd 100644 --- a/modules/opus/audio_stream_opus.h +++ b/modules/opus/audio_stream_opus.h @@ -40,7 +40,7 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback { - OBJ_TYPE(AudioStreamPlaybackOpus,AudioStreamPlayback) + GDCLASS(AudioStreamPlaybackOpus,AudioStreamPlayback) enum { MIN_MIX=1024 @@ -115,7 +115,7 @@ public: class AudioStreamOpus: public AudioStream { - OBJ_TYPE(AudioStreamOpus,AudioStream) + GDCLASS(AudioStreamOpus,AudioStream) String file; public: diff --git a/modules/opus/register_types.cpp b/modules/opus/register_types.cpp index 9d9a707994..a177bc9463 100644 --- a/modules/opus/register_types.cpp +++ b/modules/opus/register_types.cpp @@ -36,7 +36,7 @@ void register_opus_types() { opus_stream_loader = memnew( ResourceFormatLoaderAudioStreamOpus ); ResourceLoader::add_resource_format_loader(opus_stream_loader); - ObjectTypeDB::register_type<AudioStreamOpus>(); + ClassDB::register_class<AudioStreamOpus>(); } void unregister_opus_types() { diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index b650d5687d..0b07e05410 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -180,7 +180,7 @@ void ResourceFormatPVR::get_recognized_extensions(List<String> *p_extensions) co } bool ResourceFormatPVR::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatPVR::get_resource_type(const String &p_path) const { diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index c7ce2884a1..e67040b5a3 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -1481,26 +1481,26 @@ RegEx::~RegEx() { void RegExMatch::_bind_methods() { - ObjectTypeDB::bind_method(_MD("expand","template"),&RegExMatch::expand); - ObjectTypeDB::bind_method(_MD("get_group_count"),&RegExMatch::get_group_count); - ObjectTypeDB::bind_method(_MD("get_group_array"),&RegExMatch::get_group_array); - ObjectTypeDB::bind_method(_MD("get_names"),&RegExMatch::get_names); - ObjectTypeDB::bind_method(_MD("get_name_dict"),&RegExMatch::get_name_dict); - ObjectTypeDB::bind_method(_MD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); + ClassDB::bind_method(_MD("expand","template"),&RegExMatch::expand); + ClassDB::bind_method(_MD("get_group_count"),&RegExMatch::get_group_count); + ClassDB::bind_method(_MD("get_group_array"),&RegExMatch::get_group_array); + ClassDB::bind_method(_MD("get_names"),&RegExMatch::get_names); + ClassDB::bind_method(_MD("get_name_dict"),&RegExMatch::get_name_dict); + ClassDB::bind_method(_MD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); + ClassDB::bind_method(_MD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); + ClassDB::bind_method(_MD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); } void RegEx::_bind_methods() { - ObjectTypeDB::bind_method(_MD("clear"),&RegEx::clear); - ObjectTypeDB::bind_method(_MD("compile","pattern"),&RegEx::compile); - ObjectTypeDB::bind_method(_MD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("is_valid"),&RegEx::is_valid); - ObjectTypeDB::bind_method(_MD("get_pattern"),&RegEx::get_pattern); - ObjectTypeDB::bind_method(_MD("get_group_count"),&RegEx::get_group_count); - ObjectTypeDB::bind_method(_MD("get_names"),&RegEx::get_names); + ClassDB::bind_method(_MD("clear"),&RegEx::clear); + ClassDB::bind_method(_MD("compile","pattern"),&RegEx::compile); + ClassDB::bind_method(_MD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(_MD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(_MD("is_valid"),&RegEx::is_valid); + ClassDB::bind_method(_MD("get_pattern"),&RegEx::get_pattern); + ClassDB::bind_method(_MD("get_group_count"),&RegEx::get_group_count); + ClassDB::bind_method(_MD("get_names"),&RegEx::get_names); ADD_PROPERTY(PropertyInfo(Variant::STRING, "pattern"), _SCS("compile"), _SCS("get_pattern")); } diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 08b0bebdcd..193d818da3 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -40,7 +40,7 @@ class RegExNode; class RegExMatch : public Reference { - OBJ_TYPE(RegExMatch, Reference); + GDCLASS(RegExMatch, Reference); struct Group { Variant name; @@ -80,7 +80,7 @@ public: class RegEx : public Resource { - OBJ_TYPE(RegEx, Resource); + GDCLASS(RegEx, Resource); RegExNode* root; Vector<Variant> group_names; diff --git a/modules/regex/register_types.cpp b/modules/regex/register_types.cpp index b3f56cd924..d44c7e563c 100644 --- a/modules/regex/register_types.cpp +++ b/modules/regex/register_types.cpp @@ -33,8 +33,8 @@ void register_regex_types() { - ObjectTypeDB::register_type<RegExMatch>(); - ObjectTypeDB::register_type<RegEx>(); + ClassDB::register_class<RegExMatch>(); + ClassDB::register_class<RegEx>(); } void unregister_regex_types() { diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp index 043498a230..58f63465c9 100644 --- a/modules/theora/register_types.cpp +++ b/modules/theora/register_types.cpp @@ -36,7 +36,7 @@ void register_theora_types() { theora_stream_loader = memnew( ResourceFormatLoaderVideoStreamTheora ); ResourceLoader::add_resource_format_loader(theora_stream_loader); - ObjectTypeDB::register_type<VideoStreamTheora>(); + ClassDB::register_class<VideoStreamTheora>(); } void unregister_theora_types() { diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index afb8fc9860..bff9d2538d 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -43,7 +43,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { - OBJ_TYPE(VideoStreamPlaybackTheora, VideoStreamPlayback); + GDCLASS(VideoStreamPlaybackTheora, VideoStreamPlayback); enum { MAX_FRAMES = 4, @@ -165,7 +165,7 @@ public: class VideoStreamTheora : public VideoStream { - OBJ_TYPE(VideoStreamTheora,VideoStream); + GDCLASS(VideoStreamTheora,VideoStream); String file; int audio_track; diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index 793cc7288b..79bf3d50b2 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -48,58 +48,58 @@ void register_visual_script_types() { //script_language_gd->init(); ScriptServer::register_language(visual_script_language); - ObjectTypeDB::register_type<VisualScript>(); - ObjectTypeDB::register_virtual_type<VisualScriptNode>(); - ObjectTypeDB::register_virtual_type<VisualScriptFunctionState>(); - ObjectTypeDB::register_type<VisualScriptFunction>(); - ObjectTypeDB::register_type<VisualScriptOperator>(); - ObjectTypeDB::register_type<VisualScriptVariableSet>(); - ObjectTypeDB::register_type<VisualScriptVariableGet>(); - ObjectTypeDB::register_type<VisualScriptConstant>(); - ObjectTypeDB::register_type<VisualScriptIndexGet>(); - ObjectTypeDB::register_type<VisualScriptIndexSet>(); - ObjectTypeDB::register_type<VisualScriptGlobalConstant>(); - ObjectTypeDB::register_type<VisualScriptClassConstant>(); - ObjectTypeDB::register_type<VisualScriptMathConstant>(); - ObjectTypeDB::register_type<VisualScriptBasicTypeConstant>(); - ObjectTypeDB::register_type<VisualScriptEngineSingleton>(); - ObjectTypeDB::register_type<VisualScriptSceneNode>(); - ObjectTypeDB::register_type<VisualScriptSceneTree>(); - ObjectTypeDB::register_type<VisualScriptResourcePath>(); - ObjectTypeDB::register_type<VisualScriptSelf>(); - ObjectTypeDB::register_type<VisualScriptCustomNode>(); - ObjectTypeDB::register_type<VisualScriptSubCall>(); - ObjectTypeDB::register_type<VisualScriptComment>(); - ObjectTypeDB::register_type<VisualScriptConstructor>(); - ObjectTypeDB::register_type<VisualScriptLocalVar>(); - ObjectTypeDB::register_type<VisualScriptLocalVarSet>(); - ObjectTypeDB::register_type<VisualScriptInputAction>(); - ObjectTypeDB::register_type<VisualScriptDeconstruct>(); - ObjectTypeDB::register_type<VisualScriptPreload>(); - ObjectTypeDB::register_type<VisualScriptTypeCast>(); - - - ObjectTypeDB::register_type<VisualScriptFunctionCall>(); - ObjectTypeDB::register_type<VisualScriptPropertySet>(); - ObjectTypeDB::register_type<VisualScriptPropertyGet>(); -// ObjectTypeDB::register_type<VisualScriptScriptCall>(); - ObjectTypeDB::register_type<VisualScriptEmitSignal>(); - - ObjectTypeDB::register_type<VisualScriptReturn>(); - ObjectTypeDB::register_type<VisualScriptCondition>(); - ObjectTypeDB::register_type<VisualScriptWhile>(); - ObjectTypeDB::register_type<VisualScriptIterator>(); - ObjectTypeDB::register_type<VisualScriptSequence>(); - ObjectTypeDB::register_type<VisualScriptInputFilter>(); - ObjectTypeDB::register_type<VisualScriptSwitch >(); - - ObjectTypeDB::register_type<VisualScriptYield>(); - ObjectTypeDB::register_type<VisualScriptYieldSignal>(); - - ObjectTypeDB::register_type<VisualScriptBuiltinFunc>(); - - - ObjectTypeDB::register_type<VisualScriptExpression>(); + ClassDB::register_class<VisualScript>(); + ClassDB::register_virtual_class<VisualScriptNode>(); + ClassDB::register_virtual_class<VisualScriptFunctionState>(); + ClassDB::register_class<VisualScriptFunction>(); + ClassDB::register_class<VisualScriptOperator>(); + ClassDB::register_class<VisualScriptVariableSet>(); + ClassDB::register_class<VisualScriptVariableGet>(); + ClassDB::register_class<VisualScriptConstant>(); + ClassDB::register_class<VisualScriptIndexGet>(); + ClassDB::register_class<VisualScriptIndexSet>(); + ClassDB::register_class<VisualScriptGlobalConstant>(); + ClassDB::register_class<VisualScriptClassConstant>(); + ClassDB::register_class<VisualScriptMathConstant>(); + ClassDB::register_class<VisualScriptBasicTypeConstant>(); + ClassDB::register_class<VisualScriptEngineSingleton>(); + ClassDB::register_class<VisualScriptSceneNode>(); + ClassDB::register_class<VisualScriptSceneTree>(); + ClassDB::register_class<VisualScriptResourcePath>(); + ClassDB::register_class<VisualScriptSelf>(); + ClassDB::register_class<VisualScriptCustomNode>(); + ClassDB::register_class<VisualScriptSubCall>(); + ClassDB::register_class<VisualScriptComment>(); + ClassDB::register_class<VisualScriptConstructor>(); + ClassDB::register_class<VisualScriptLocalVar>(); + ClassDB::register_class<VisualScriptLocalVarSet>(); + ClassDB::register_class<VisualScriptInputAction>(); + ClassDB::register_class<VisualScriptDeconstruct>(); + ClassDB::register_class<VisualScriptPreload>(); + ClassDB::register_class<VisualScriptTypeCast>(); + + + ClassDB::register_class<VisualScriptFunctionCall>(); + ClassDB::register_class<VisualScriptPropertySet>(); + ClassDB::register_class<VisualScriptPropertyGet>(); +// ClassDB::register_type<VisualScriptScriptCall>(); + ClassDB::register_class<VisualScriptEmitSignal>(); + + ClassDB::register_class<VisualScriptReturn>(); + ClassDB::register_class<VisualScriptCondition>(); + ClassDB::register_class<VisualScriptWhile>(); + ClassDB::register_class<VisualScriptIterator>(); + ClassDB::register_class<VisualScriptSequence>(); + ClassDB::register_class<VisualScriptInputFilter>(); + ClassDB::register_class<VisualScriptSwitch >(); + + ClassDB::register_class<VisualScriptYield>(); + ClassDB::register_class<VisualScriptYieldSignal>(); + + ClassDB::register_class<VisualScriptBuiltinFunc>(); + + + ClassDB::register_class<VisualScriptExpression>(); register_visual_script_nodes(); register_visual_script_func_nodes(); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index bd042c8989..64b949bb6f 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -104,11 +104,11 @@ Array VisualScriptNode::_get_default_input_values() const { void VisualScriptNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); - ObjectTypeDB::bind_method(_MD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); - ObjectTypeDB::bind_method(_MD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); - ObjectTypeDB::bind_method(_MD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); - ObjectTypeDB::bind_method(_MD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); + ClassDB::bind_method(_MD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); + ClassDB::bind_method(_MD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); + ClassDB::bind_method(_MD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); + ClassDB::bind_method(_MD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); + ClassDB::bind_method(_MD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"_default_input_values",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_default_input_values"),_SCS("_get_default_input_values")); ADD_SIGNAL(MethodInfo("ports_changed")); @@ -122,7 +122,7 @@ VisualScriptNode::TypeGuess VisualScriptNode::guess_output_type(TypeGuess* p_inp tg.type=pinfo.type; if (pinfo.hint==PROPERTY_HINT_RESOURCE_TYPE) { - tg.obj_type=pinfo.hint_string; + tg.GDCLASS=pinfo.hint_string; } return tg; @@ -1317,63 +1317,63 @@ void VisualScript::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_node_ports_changed"),&VisualScript::_node_ports_changed); - - ObjectTypeDB::bind_method(_MD("add_function","name"),&VisualScript::add_function); - ObjectTypeDB::bind_method(_MD("has_function","name"),&VisualScript::has_function); - ObjectTypeDB::bind_method(_MD("remove_function","name"),&VisualScript::remove_function); - ObjectTypeDB::bind_method(_MD("rename_function","name","new_name"),&VisualScript::rename_function); - ObjectTypeDB::bind_method(_MD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); - ObjectTypeDB::bind_method(_MD("get_function_scroll"),&VisualScript::get_function_scroll); - - ObjectTypeDB::bind_method(_MD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); - ObjectTypeDB::bind_method(_MD("remove_node","func","id"),&VisualScript::remove_node); - ObjectTypeDB::bind_method(_MD("get_function_node_id","name"),&VisualScript::get_function_node_id); - - ObjectTypeDB::bind_method(_MD("get_node","func","id"),&VisualScript::get_node); - ObjectTypeDB::bind_method(_MD("has_node","func","id"),&VisualScript::has_node); - ObjectTypeDB::bind_method(_MD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); - ObjectTypeDB::bind_method(_MD("get_node_pos","func","id"),&VisualScript::get_node_pos); - - ObjectTypeDB::bind_method(_MD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); - ObjectTypeDB::bind_method(_MD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); - ObjectTypeDB::bind_method(_MD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); - - ObjectTypeDB::bind_method(_MD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); - ObjectTypeDB::bind_method(_MD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); - ObjectTypeDB::bind_method(_MD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); - - ObjectTypeDB::bind_method(_MD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("has_variable","name"),&VisualScript::has_variable); - ObjectTypeDB::bind_method(_MD("remove_variable","name"),&VisualScript::remove_variable); - ObjectTypeDB::bind_method(_MD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); - ObjectTypeDB::bind_method(_MD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); - ObjectTypeDB::bind_method(_MD("set_variable_info","name","value"),&VisualScript::_set_variable_info); - ObjectTypeDB::bind_method(_MD("get_variable_info","name"),&VisualScript::_get_variable_info); - ObjectTypeDB::bind_method(_MD("set_variable_export","name","enable"),&VisualScript::set_variable_export); - ObjectTypeDB::bind_method(_MD("get_variable_export","name"),&VisualScript::get_variable_export); - ObjectTypeDB::bind_method(_MD("rename_variable","name","new_name"),&VisualScript::rename_variable); - - ObjectTypeDB::bind_method(_MD("add_custom_signal","name"),&VisualScript::add_custom_signal); - ObjectTypeDB::bind_method(_MD("has_custom_signal","name"),&VisualScript::has_custom_signal); - ObjectTypeDB::bind_method(_MD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); - ObjectTypeDB::bind_method(_MD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); - ObjectTypeDB::bind_method(_MD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); - ObjectTypeDB::bind_method(_MD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); - ObjectTypeDB::bind_method(_MD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); - ObjectTypeDB::bind_method(_MD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); - - //ObjectTypeDB::bind_method(_MD("set_variable_info","name","info"),&VScript::set_variable_info); - //ObjectTypeDB::bind_method(_MD("get_variable_info","name"),&VScript::set_variable_info); - - ObjectTypeDB::bind_method(_MD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); - - ObjectTypeDB::bind_method(_MD("_set_data","data"),&VisualScript::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&VisualScript::_get_data); + ClassDB::bind_method(_MD("_node_ports_changed"),&VisualScript::_node_ports_changed); + + ClassDB::bind_method(_MD("add_function","name"),&VisualScript::add_function); + ClassDB::bind_method(_MD("has_function","name"),&VisualScript::has_function); + ClassDB::bind_method(_MD("remove_function","name"),&VisualScript::remove_function); + ClassDB::bind_method(_MD("rename_function","name","new_name"),&VisualScript::rename_function); + ClassDB::bind_method(_MD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); + ClassDB::bind_method(_MD("get_function_scroll"),&VisualScript::get_function_scroll); + + ClassDB::bind_method(_MD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); + ClassDB::bind_method(_MD("remove_node","func","id"),&VisualScript::remove_node); + ClassDB::bind_method(_MD("get_function_node_id","name"),&VisualScript::get_function_node_id); + + ClassDB::bind_method(_MD("get_node","func","id"),&VisualScript::get_node); + ClassDB::bind_method(_MD("has_node","func","id"),&VisualScript::has_node); + ClassDB::bind_method(_MD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); + ClassDB::bind_method(_MD("get_node_pos","func","id"),&VisualScript::get_node_pos); + + ClassDB::bind_method(_MD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); + ClassDB::bind_method(_MD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); + ClassDB::bind_method(_MD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); + + ClassDB::bind_method(_MD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); + ClassDB::bind_method(_MD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); + ClassDB::bind_method(_MD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); + + ClassDB::bind_method(_MD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); + ClassDB::bind_method(_MD("has_variable","name"),&VisualScript::has_variable); + ClassDB::bind_method(_MD("remove_variable","name"),&VisualScript::remove_variable); + ClassDB::bind_method(_MD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); + ClassDB::bind_method(_MD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); + ClassDB::bind_method(_MD("set_variable_info","name","value"),&VisualScript::_set_variable_info); + ClassDB::bind_method(_MD("get_variable_info","name"),&VisualScript::_get_variable_info); + ClassDB::bind_method(_MD("set_variable_export","name","enable"),&VisualScript::set_variable_export); + ClassDB::bind_method(_MD("get_variable_export","name"),&VisualScript::get_variable_export); + ClassDB::bind_method(_MD("rename_variable","name","new_name"),&VisualScript::rename_variable); + + ClassDB::bind_method(_MD("add_custom_signal","name"),&VisualScript::add_custom_signal); + ClassDB::bind_method(_MD("has_custom_signal","name"),&VisualScript::has_custom_signal); + ClassDB::bind_method(_MD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); + ClassDB::bind_method(_MD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); + ClassDB::bind_method(_MD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); + ClassDB::bind_method(_MD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); + ClassDB::bind_method(_MD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); + ClassDB::bind_method(_MD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); + ClassDB::bind_method(_MD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); + ClassDB::bind_method(_MD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); + ClassDB::bind_method(_MD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); + ClassDB::bind_method(_MD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); + + //ClassDB::bind_method(_MD("set_variable_info","name","info"),&VScript::set_variable_info); + //ClassDB::bind_method(_MD("get_variable_info","name"),&VScript::set_variable_info); + + ClassDB::bind_method(_MD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); + + ClassDB::bind_method(_MD("_set_data","data"),&VisualScript::_set_data); + ClassDB::bind_method(_MD("_get_data"),&VisualScript::_get_data); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); @@ -1573,7 +1573,7 @@ Variant VisualScriptInstance::_call_internal(const StringName& p_method, void* p p_pass++; //increment pass current_node_id=node->get_id(); - VSDEBUG("==========AT NODE: "+itos(current_node_id)+" base: "+node->get_base_node()->get_type()); + VSDEBUG("==========AT NODE: "+itos(current_node_id)+" base: "+node->get_base_node()->get_class_name()); VSDEBUG("AT STACK POS: "+itos(flow_stack_pos)); @@ -2436,10 +2436,10 @@ Variant VisualScriptFunctionState::resume(Array p_args) { void VisualScriptFunctionState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); - ObjectTypeDB::bind_method(_MD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("is_valid"),&VisualScriptFunctionState::is_valid); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&VisualScriptFunctionState::_signal_callback,MethodInfo("_signal_callback")); + ClassDB::bind_method(_MD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); + ClassDB::bind_method(_MD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(_MD("is_valid"),&VisualScriptFunctionState::is_valid); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&VisualScriptFunctionState::_signal_callback,MethodInfo("_signal_callback")); } VisualScriptFunctionState::VisualScriptFunctionState() { diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 63b018b0c2..340db21c32 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -9,7 +9,7 @@ class VisualScriptNodeInstance; class VisualScript; class VisualScriptNode : public Resource { - OBJ_TYPE(VisualScriptNode,Resource) + GDCLASS(VisualScriptNode,Resource) friend class VisualScript; @@ -64,7 +64,7 @@ public: Variant::Type type; InputEvent::Type ev_type; - StringName obj_type; + StringName GDCLASS; Ref<Script> script; TypeGuess() { type=Variant::NIL; ev_type=InputEvent::NONE; } @@ -143,7 +143,7 @@ public: class VisualScript : public Script { - OBJ_TYPE( VisualScript, Script ) + GDCLASS( VisualScript, Script ) RES_BASE_EXTENSION("vs"); @@ -437,7 +437,7 @@ public: class VisualScriptFunctionState : public Reference { - OBJ_TYPE(VisualScriptFunctionState,Reference); + GDCLASS(VisualScriptFunctionState,Reference); friend class VisualScriptInstance; ObjectID instance_id; diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 2bfb6bc9ea..58dbfbc5ad 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -981,7 +981,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp case VisualScriptBuiltinFunc::TYPE_EXISTS: { - *r_return = ObjectTypeDB::type_exists(*p_inputs[0]); + *r_return = ClassDB::class_exists(*p_inputs[0]); } break; case VisualScriptBuiltinFunc::TEXT_CHAR: { @@ -1145,8 +1145,8 @@ VisualScriptNodeInstance* VisualScriptBuiltinFunc::instance(VisualScriptInstance void VisualScriptBuiltinFunc::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_func","which"),&VisualScriptBuiltinFunc::set_func); - ObjectTypeDB::bind_method(_MD("get_func"),&VisualScriptBuiltinFunc::get_func); + ClassDB::bind_method(_MD("set_func","which"),&VisualScriptBuiltinFunc::set_func); + ClassDB::bind_method(_MD("get_func"),&VisualScriptBuiltinFunc::get_func); String cc; diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index 8b0d70c1ea..fba2099598 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -6,7 +6,7 @@ class VisualScriptBuiltinFunc : public VisualScriptNode { - OBJ_TYPE(VisualScriptBuiltinFunc,VisualScriptNode) + GDCLASS(VisualScriptBuiltinFunc,VisualScriptNode) public: enum BuiltinFunc { diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 02d3c453c4..f9285fcf6c 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -11,7 +11,7 @@ #ifdef TOOLS_ENABLED class VisualScriptEditorSignalEdit : public Object { - OBJ_TYPE(VisualScriptEditorSignalEdit,Object) + GDCLASS(VisualScriptEditorSignalEdit,Object) StringName sig; public: @@ -22,7 +22,7 @@ public: protected: static void _bind_methods() { - ObjectTypeDB::bind_method("_sig_changed",&VisualScriptEditorSignalEdit::_sig_changed); + ClassDB::bind_method("_sig_changed",&VisualScriptEditorSignalEdit::_sig_changed); } void _sig_changed() { @@ -160,7 +160,7 @@ public: class VisualScriptEditorVariableEdit : public Object { - OBJ_TYPE(VisualScriptEditorVariableEdit,Object) + GDCLASS(VisualScriptEditorVariableEdit,Object) StringName var; public: @@ -171,8 +171,8 @@ public: protected: static void _bind_methods() { - ObjectTypeDB::bind_method("_var_changed",&VisualScriptEditorVariableEdit::_var_changed); - ObjectTypeDB::bind_method("_var_value_changed",&VisualScriptEditorVariableEdit::_var_value_changed); + ClassDB::bind_method("_var_changed",&VisualScriptEditorVariableEdit::_var_changed); + ClassDB::bind_method("_var_value_changed",&VisualScriptEditorVariableEdit::_var_value_changed); } void _var_changed() { @@ -990,7 +990,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt virtuals_in_menu.clear(); List<MethodInfo> mi; - ObjectTypeDB::get_method_list(script->get_instance_base_type(),&mi); + ClassDB::get_method_list(script->get_instance_base_type(),&mi); for (List<MethodInfo>::Element *E=mi.front();E;E=E->next()) { MethodInfo mi=E->get(); if (mi.flags&METHOD_FLAG_VIRTUAL) { @@ -1917,7 +1917,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat call.instance(); call->set_call_mode(VisualScriptFunctionCall::CALL_MODE_NODE_PATH); call->set_base_path(sn->get_path_to(node));; - call->set_base_type(node->get_type()); + call->set_base_type(node->get_class()); n=call; method_select->select_method_from_instance(node); @@ -1986,7 +1986,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat Ref<VisualScriptPropertySet> pset; pset.instance(); pset->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE); - pset->set_base_type(obj->get_type()); + pset->set_base_type(obj->get_class()); /*if (use_value) { pset->set_use_builtin_value(true); pset->set_builtin_value(d["value"]); @@ -1997,7 +1997,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat Ref<VisualScriptPropertyGet> pget; pget.instance(); pget->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE); - pget->set_base_type(obj->get_type()); + pget->set_base_type(obj->get_class()); vnode=pget; @@ -2171,7 +2171,7 @@ String VisualScriptEditor::get_name(){ } else if (script->get_name()!="") name=script->get_name(); else - name=script->get_type()+"("+itos(script->get_instance_ID())+")"; + name=script->get_class()+"("+itos(script->get_instance_ID())+")"; return name; @@ -2704,7 +2704,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node,i if (obj) { g.type=Variant::OBJECT; - g.obj_type=obj->get_type(); + g.GDCLASS=obj->get_class(); g.script=obj->get_script(); } } @@ -2745,8 +2745,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptFunctionCall::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -2780,8 +2780,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -2811,8 +2811,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -3232,55 +3232,55 @@ void VisualScriptEditor::_menu_option(int p_what) { void VisualScriptEditor::_bind_methods() { - ObjectTypeDB::bind_method("_member_button",&VisualScriptEditor::_member_button); - ObjectTypeDB::bind_method("_member_edited",&VisualScriptEditor::_member_edited); - ObjectTypeDB::bind_method("_member_selected",&VisualScriptEditor::_member_selected); - ObjectTypeDB::bind_method("_update_members",&VisualScriptEditor::_update_members); - ObjectTypeDB::bind_method("_change_base_type",&VisualScriptEditor::_change_base_type); - ObjectTypeDB::bind_method("_change_base_type_callback",&VisualScriptEditor::_change_base_type_callback); - ObjectTypeDB::bind_method("_override_pressed",&VisualScriptEditor::_override_pressed); - ObjectTypeDB::bind_method("_node_selected",&VisualScriptEditor::_node_selected); - ObjectTypeDB::bind_method("_node_moved",&VisualScriptEditor::_node_moved); - ObjectTypeDB::bind_method("_move_node",&VisualScriptEditor::_move_node); - ObjectTypeDB::bind_method("_begin_node_move",&VisualScriptEditor::_begin_node_move); - ObjectTypeDB::bind_method("_end_node_move",&VisualScriptEditor::_end_node_move); - ObjectTypeDB::bind_method("_remove_node",&VisualScriptEditor::_remove_node); - ObjectTypeDB::bind_method("_update_graph",&VisualScriptEditor::_update_graph,DEFVAL(-1)); - ObjectTypeDB::bind_method("_node_ports_changed",&VisualScriptEditor::_node_ports_changed); - ObjectTypeDB::bind_method("_available_node_doubleclicked",&VisualScriptEditor::_available_node_doubleclicked); - ObjectTypeDB::bind_method("_default_value_edited",&VisualScriptEditor::_default_value_edited); - ObjectTypeDB::bind_method("_default_value_changed",&VisualScriptEditor::_default_value_changed); - ObjectTypeDB::bind_method("_menu_option",&VisualScriptEditor::_menu_option); - ObjectTypeDB::bind_method("_graph_ofs_changed",&VisualScriptEditor::_graph_ofs_changed); - ObjectTypeDB::bind_method("_center_on_node",&VisualScriptEditor::_center_on_node); - ObjectTypeDB::bind_method("_comment_node_resized",&VisualScriptEditor::_comment_node_resized); - ObjectTypeDB::bind_method("_button_resource_previewed",&VisualScriptEditor::_button_resource_previewed); - ObjectTypeDB::bind_method("_port_action_menu",&VisualScriptEditor::_port_action_menu); - ObjectTypeDB::bind_method("_selected_connect_node_method_or_setget",&VisualScriptEditor::_selected_connect_node_method_or_setget); - ObjectTypeDB::bind_method("_expression_text_changed",&VisualScriptEditor::_expression_text_changed); - - - - - ObjectTypeDB::bind_method("get_drag_data_fw",&VisualScriptEditor::get_drag_data_fw); - ObjectTypeDB::bind_method("can_drop_data_fw",&VisualScriptEditor::can_drop_data_fw); - ObjectTypeDB::bind_method("drop_data_fw",&VisualScriptEditor::drop_data_fw); - - ObjectTypeDB::bind_method("_input",&VisualScriptEditor::_input); - ObjectTypeDB::bind_method("_on_nodes_delete",&VisualScriptEditor::_on_nodes_delete); - ObjectTypeDB::bind_method("_on_nodes_duplicate",&VisualScriptEditor::_on_nodes_duplicate); - - ObjectTypeDB::bind_method("_hide_timer",&VisualScriptEditor::_hide_timer); - - ObjectTypeDB::bind_method("_graph_connected",&VisualScriptEditor::_graph_connected); - ObjectTypeDB::bind_method("_graph_disconnected",&VisualScriptEditor::_graph_disconnected); - ObjectTypeDB::bind_method("_graph_connect_to_empty",&VisualScriptEditor::_graph_connect_to_empty); - - ObjectTypeDB::bind_method("_update_graph_connections",&VisualScriptEditor::_update_graph_connections); - ObjectTypeDB::bind_method("_node_filter_changed",&VisualScriptEditor::_node_filter_changed); - - ObjectTypeDB::bind_method("_selected_method",&VisualScriptEditor::_selected_method); - ObjectTypeDB::bind_method("_draw_color_over_button",&VisualScriptEditor::_draw_color_over_button); + ClassDB::bind_method("_member_button",&VisualScriptEditor::_member_button); + ClassDB::bind_method("_member_edited",&VisualScriptEditor::_member_edited); + ClassDB::bind_method("_member_selected",&VisualScriptEditor::_member_selected); + ClassDB::bind_method("_update_members",&VisualScriptEditor::_update_members); + ClassDB::bind_method("_change_base_type",&VisualScriptEditor::_change_base_type); + ClassDB::bind_method("_change_base_type_callback",&VisualScriptEditor::_change_base_type_callback); + ClassDB::bind_method("_override_pressed",&VisualScriptEditor::_override_pressed); + ClassDB::bind_method("_node_selected",&VisualScriptEditor::_node_selected); + ClassDB::bind_method("_node_moved",&VisualScriptEditor::_node_moved); + ClassDB::bind_method("_move_node",&VisualScriptEditor::_move_node); + ClassDB::bind_method("_begin_node_move",&VisualScriptEditor::_begin_node_move); + ClassDB::bind_method("_end_node_move",&VisualScriptEditor::_end_node_move); + ClassDB::bind_method("_remove_node",&VisualScriptEditor::_remove_node); + ClassDB::bind_method("_update_graph",&VisualScriptEditor::_update_graph,DEFVAL(-1)); + ClassDB::bind_method("_node_ports_changed",&VisualScriptEditor::_node_ports_changed); + ClassDB::bind_method("_available_node_doubleclicked",&VisualScriptEditor::_available_node_doubleclicked); + ClassDB::bind_method("_default_value_edited",&VisualScriptEditor::_default_value_edited); + ClassDB::bind_method("_default_value_changed",&VisualScriptEditor::_default_value_changed); + ClassDB::bind_method("_menu_option",&VisualScriptEditor::_menu_option); + ClassDB::bind_method("_graph_ofs_changed",&VisualScriptEditor::_graph_ofs_changed); + ClassDB::bind_method("_center_on_node",&VisualScriptEditor::_center_on_node); + ClassDB::bind_method("_comment_node_resized",&VisualScriptEditor::_comment_node_resized); + ClassDB::bind_method("_button_resource_previewed",&VisualScriptEditor::_button_resource_previewed); + ClassDB::bind_method("_port_action_menu",&VisualScriptEditor::_port_action_menu); + ClassDB::bind_method("_selected_connect_node_method_or_setget",&VisualScriptEditor::_selected_connect_node_method_or_setget); + ClassDB::bind_method("_expression_text_changed",&VisualScriptEditor::_expression_text_changed); + + + + + ClassDB::bind_method("get_drag_data_fw",&VisualScriptEditor::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw",&VisualScriptEditor::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw",&VisualScriptEditor::drop_data_fw); + + ClassDB::bind_method("_input",&VisualScriptEditor::_input); + ClassDB::bind_method("_on_nodes_delete",&VisualScriptEditor::_on_nodes_delete); + ClassDB::bind_method("_on_nodes_duplicate",&VisualScriptEditor::_on_nodes_duplicate); + + ClassDB::bind_method("_hide_timer",&VisualScriptEditor::_hide_timer); + + ClassDB::bind_method("_graph_connected",&VisualScriptEditor::_graph_connected); + ClassDB::bind_method("_graph_disconnected",&VisualScriptEditor::_graph_disconnected); + ClassDB::bind_method("_graph_connect_to_empty",&VisualScriptEditor::_graph_connect_to_empty); + + ClassDB::bind_method("_update_graph_connections",&VisualScriptEditor::_update_graph_connections); + ClassDB::bind_method("_node_filter_changed",&VisualScriptEditor::_node_filter_changed); + + ClassDB::bind_method("_selected_method",&VisualScriptEditor::_selected_method); + ClassDB::bind_method("_draw_color_over_button",&VisualScriptEditor::_draw_color_over_button); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 483ae1644c..dbd5d220c2 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -15,7 +15,7 @@ class VisualScriptEditorVariableEdit; class VisualScriptEditor : public ScriptEditorBase { - OBJ_TYPE(VisualScriptEditor,ScriptEditorBase) + GDCLASS(VisualScriptEditor,ScriptEditorBase) enum { TYPE_SEQUENCE=1000, diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h index 4edae133c7..a67656a4b1 100644 --- a/modules/visual_script/visual_script_expression.h +++ b/modules/visual_script/visual_script_expression.h @@ -6,7 +6,7 @@ class VisualScriptExpression : public VisualScriptNode { - OBJ_TYPE(VisualScriptExpression,VisualScriptNode) + GDCLASS(VisualScriptExpression,VisualScriptNode) friend class VisualScriptNodeInstanceExpression; struct Input { diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 97338da187..606a2f47a8 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -81,10 +81,10 @@ bool VisualScriptReturn::is_return_value_enabled() const { void VisualScriptReturn::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_return_type","type"),&VisualScriptReturn::set_return_type); - ObjectTypeDB::bind_method(_MD("get_return_type"),&VisualScriptReturn::get_return_type); - ObjectTypeDB::bind_method(_MD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); - ObjectTypeDB::bind_method(_MD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); + ClassDB::bind_method(_MD("set_return_type","type"),&VisualScriptReturn::set_return_type); + ClassDB::bind_method(_MD("get_return_type"),&VisualScriptReturn::get_return_type); + ClassDB::bind_method(_MD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); + ClassDB::bind_method(_MD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -544,8 +544,8 @@ int VisualScriptSequence::get_steps() const { void VisualScriptSequence::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_steps","steps"),&VisualScriptSequence::set_steps); - ObjectTypeDB::bind_method(_MD("get_steps"),&VisualScriptSequence::get_steps); + ClassDB::bind_method(_MD("set_steps","steps"),&VisualScriptSequence::set_steps); + ClassDB::bind_method(_MD("get_steps"),&VisualScriptSequence::get_steps); ADD_PROPERTY(PropertyInfo(Variant::INT,"steps",PROPERTY_HINT_RANGE,"1,64,1"),_SCS("set_steps"),_SCS("get_steps")); @@ -1869,7 +1869,7 @@ public: return 1; //not found sorry } - if (ObjectTypeDB::is_type(obj->get_type_name(),base_type)) { + if (ClassDB::is_parent_class(obj->get_class_name(),base_type)) { *p_outputs[0]=*p_inputs[0]; //copy return 0; } else @@ -1893,11 +1893,11 @@ VisualScriptNodeInstance* VisualScriptTypeCast::instance(VisualScriptInstance* p void VisualScriptTypeCast::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptTypeCast::get_base_type); + ClassDB::bind_method(_MD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptTypeCast::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptTypeCast::get_base_script); + ClassDB::bind_method(_MD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptTypeCast::get_base_script); List<String> script_extensions; diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h index e0da84a534..26e981cb1e 100644 --- a/modules/visual_script/visual_script_flow_control.h +++ b/modules/visual_script/visual_script_flow_control.h @@ -5,7 +5,7 @@ class VisualScriptReturn : public VisualScriptNode { - OBJ_TYPE(VisualScriptReturn,VisualScriptNode) + GDCLASS(VisualScriptReturn,VisualScriptNode) Variant::Type type; @@ -48,7 +48,7 @@ public: class VisualScriptCondition : public VisualScriptNode { - OBJ_TYPE(VisualScriptCondition,VisualScriptNode) + GDCLASS(VisualScriptCondition,VisualScriptNode) @@ -84,7 +84,7 @@ public: class VisualScriptWhile : public VisualScriptNode { - OBJ_TYPE(VisualScriptWhile,VisualScriptNode) + GDCLASS(VisualScriptWhile,VisualScriptNode) @@ -121,7 +121,7 @@ public: class VisualScriptIterator : public VisualScriptNode { - OBJ_TYPE(VisualScriptIterator,VisualScriptNode) + GDCLASS(VisualScriptIterator,VisualScriptNode) @@ -158,7 +158,7 @@ public: class VisualScriptSequence : public VisualScriptNode { - OBJ_TYPE(VisualScriptSequence,VisualScriptNode) + GDCLASS(VisualScriptSequence,VisualScriptNode) int steps; @@ -199,7 +199,7 @@ public: class VisualScriptSwitch : public VisualScriptNode { - OBJ_TYPE(VisualScriptSwitch,VisualScriptNode) + GDCLASS(VisualScriptSwitch,VisualScriptNode) struct Case { Variant::Type type; @@ -248,7 +248,7 @@ public: class VisualScriptInputFilter : public VisualScriptNode { - OBJ_TYPE(VisualScriptInputFilter,VisualScriptNode) + GDCLASS(VisualScriptInputFilter,VisualScriptNode) Vector<InputEvent> filters; @@ -290,7 +290,7 @@ public: class VisualScriptTypeCast : public VisualScriptNode { - OBJ_TYPE(VisualScriptTypeCast,VisualScriptNode) + GDCLASS(VisualScriptTypeCast,VisualScriptNode) StringName base_type; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 5a21cb40e9..f1424af2fe 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -92,7 +92,7 @@ StringName VisualScriptFunctionCall::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -110,7 +110,7 @@ int VisualScriptFunctionCall::get_input_value_port_count() const{ } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { return mb->get_argument_count() + (call_mode==CALL_MODE_INSTANCE?1:0) + (rpc_call_mode>=RPC_RELIABLE_TO_ID?1:0) - use_default_args; } @@ -129,7 +129,7 @@ int VisualScriptFunctionCall::get_output_value_port_count() const{ } else { int ret; - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { ret = mb->has_return() ? 1 : 0; } else @@ -182,7 +182,7 @@ PropertyInfo VisualScriptFunctionCall::get_input_value_port_info(int p_idx) cons } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { return mb->get_argument_info(p_idx); } @@ -220,7 +220,7 @@ PropertyInfo VisualScriptFunctionCall::get_output_value_port_info(int p_idx) con PropertyInfo ret; - /*MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + /*MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { ret = mb->get_argument_info(-1); @@ -334,7 +334,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName& p_path) { singleton=p_path; Object *obj = Globals::get_singleton()->get_singleton_object(singleton); if (obj) { - base_type=obj->get_type(); + base_type=obj->get_class(); } _change_notify(); @@ -356,7 +356,7 @@ void VisualScriptFunctionCall::_update_method_cache() { Node* node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -372,7 +372,7 @@ void VisualScriptFunctionCall::_update_method_cache() { Object *obj = Globals::get_singleton()->get_singleton_object(singleton); if (obj) { - type=obj->get_type(); + type=obj->get_class(); script=obj->get_script(); } @@ -397,7 +397,7 @@ void VisualScriptFunctionCall::_update_method_cache() { // print_line("BASE: "+String(type)+" FUNC: "+String(function)); - MethodBind *mb = ObjectTypeDB::get_method(type,function); + MethodBind *mb = ClassDB::get_method(type,function); if (mb) { use_default_args=mb->get_default_argument_count(); method_cache = MethodInfo(); @@ -661,7 +661,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const mc = Variant::get_method_default_arguments(basic_type,function).size(); } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { mc=mb->get_default_argument_count(); @@ -687,38 +687,38 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const void VisualScriptFunctionCall::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptFunctionCall::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptFunctionCall::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptFunctionCall::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptFunctionCall::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); - ObjectTypeDB::bind_method(_MD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton"),&VisualScriptFunctionCall::get_singleton); + ClassDB::bind_method(_MD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); + ClassDB::bind_method(_MD("get_singleton"),&VisualScriptFunctionCall::get_singleton); - ObjectTypeDB::bind_method(_MD("set_function","function"),&VisualScriptFunctionCall::set_function); - ObjectTypeDB::bind_method(_MD("get_function"),&VisualScriptFunctionCall::get_function); + ClassDB::bind_method(_MD("set_function","function"),&VisualScriptFunctionCall::set_function); + ClassDB::bind_method(_MD("get_function"),&VisualScriptFunctionCall::get_function); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptFunctionCall::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptFunctionCall::get_base_path); - ObjectTypeDB::bind_method(_MD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); - ObjectTypeDB::bind_method(_MD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); + ClassDB::bind_method(_MD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); + ClassDB::bind_method(_MD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); - ObjectTypeDB::bind_method(_MD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); - ObjectTypeDB::bind_method(_MD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); + ClassDB::bind_method(_MD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); + ClassDB::bind_method(_MD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); - ObjectTypeDB::bind_method(_MD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); - ObjectTypeDB::bind_method(_MD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); + ClassDB::bind_method(_MD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); + ClassDB::bind_method(_MD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); - ObjectTypeDB::bind_method(_MD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); - ObjectTypeDB::bind_method(_MD("get_validate"),&VisualScriptFunctionCall::get_validate); + ClassDB::bind_method(_MD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); + ClassDB::bind_method(_MD("get_validate"),&VisualScriptFunctionCall::get_validate); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -1034,7 +1034,7 @@ StringName VisualScriptPropertySet::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -1122,7 +1122,7 @@ void VisualScriptPropertySet::_update_base_type() { Node* node=_get_base_node(); if (node) { - base_type=node->get_type(); + base_type=node->get_class(); } } else if (call_mode==CALL_MODE_SELF) { @@ -1247,7 +1247,7 @@ void VisualScriptPropertySet::_update_cache() { node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -1284,7 +1284,7 @@ void VisualScriptPropertySet::_update_cache() { node->get_property_list(&pinfo); } else { - ObjectTypeDB::get_property_list(type,&pinfo); + ClassDB::get_property_list(type,&pinfo); } if (script.is_valid()) { @@ -1453,29 +1453,29 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertySet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptPropertySet::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertySet::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptPropertySet::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertySet::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); - ObjectTypeDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); - ObjectTypeDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); + ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); + ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); - ObjectTypeDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); - ObjectTypeDB::bind_method(_MD("get_event_type"),&VisualScriptPropertySet::get_event_type); + ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); + ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertySet::get_event_type); - ObjectTypeDB::bind_method(_MD("set_property","property"),&VisualScriptPropertySet::set_property); - ObjectTypeDB::bind_method(_MD("get_property"),&VisualScriptPropertySet::get_property); + ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertySet::set_property); + ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertySet::get_property); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptPropertySet::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertySet::get_base_path); @@ -1554,7 +1554,7 @@ public: if (!valid) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; - r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+object->get_type(); + r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+object->get_class(); } } break; case VisualScriptPropertySet::CALL_MODE_NODE_PATH: { @@ -1579,7 +1579,7 @@ public: if (!valid) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; - r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+another->get_type(); + r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+another->get_class(); } } break; @@ -1669,7 +1669,7 @@ void VisualScriptPropertyGet::_update_base_type() { Node* node=_get_base_node(); if (node) { - base_type=node->get_type(); + base_type=node->get_class(); } } else if (call_mode==CALL_MODE_SELF) { @@ -1724,7 +1724,7 @@ StringName VisualScriptPropertyGet::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -1868,7 +1868,7 @@ void VisualScriptPropertyGet::_update_cache() { node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -1903,7 +1903,7 @@ void VisualScriptPropertyGet::_update_cache() { Variant::Type type_ret; - type_ret=ObjectTypeDB::get_property_type(base_type,property,&valid); + type_ret=ClassDB::get_property_type(base_type,property,&valid); if (valid) { type_cache=type_ret; @@ -2117,30 +2117,30 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertyGet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptPropertyGet::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertyGet::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptPropertyGet::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertyGet::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); - ObjectTypeDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); - ObjectTypeDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); + ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); + ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); - ObjectTypeDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); - ObjectTypeDB::bind_method(_MD("get_event_type"),&VisualScriptPropertyGet::get_event_type); + ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); + ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertyGet::get_event_type); - ObjectTypeDB::bind_method(_MD("set_property","property"),&VisualScriptPropertyGet::set_property); - ObjectTypeDB::bind_method(_MD("get_property"),&VisualScriptPropertyGet::get_property); + ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertyGet::set_property); + ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertyGet::get_property); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptPropertyGet::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertyGet::get_base_path); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -2420,8 +2420,8 @@ void VisualScriptEmitSignal::_validate_property(PropertyInfo& property) const { void VisualScriptEmitSignal::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_signal","name"),&VisualScriptEmitSignal::set_signal); - ObjectTypeDB::bind_method(_MD("get_signal"),&VisualScriptEmitSignal::get_signal); + ClassDB::bind_method(_MD("set_signal","name"),&VisualScriptEmitSignal::set_signal); + ClassDB::bind_method(_MD("get_signal"),&VisualScriptEmitSignal::get_signal); ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),_SCS("set_signal"),_SCS("get_signal")); diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h index 43ef276cf4..7d33549e21 100644 --- a/modules/visual_script/visual_script_func_nodes.h +++ b/modules/visual_script/visual_script_func_nodes.h @@ -6,7 +6,7 @@ class VisualScriptFunctionCall : public VisualScriptNode { - OBJ_TYPE(VisualScriptFunctionCall,VisualScriptNode) + GDCLASS(VisualScriptFunctionCall,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -117,7 +117,7 @@ VARIANT_ENUM_CAST(VisualScriptFunctionCall::RPCCallMode ); class VisualScriptPropertySet : public VisualScriptNode { - OBJ_TYPE(VisualScriptPropertySet,VisualScriptNode) + GDCLASS(VisualScriptPropertySet,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -208,7 +208,7 @@ VARIANT_ENUM_CAST(VisualScriptPropertySet::CallMode ); class VisualScriptPropertyGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptPropertyGet,VisualScriptNode) + GDCLASS(VisualScriptPropertyGet,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -299,7 +299,7 @@ VARIANT_ENUM_CAST(VisualScriptPropertyGet::CallMode ); class VisualScriptEmitSignal : public VisualScriptNode { - OBJ_TYPE(VisualScriptEmitSignal,VisualScriptNode) + GDCLASS(VisualScriptEmitSignal,VisualScriptNode) private: diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 8ffbcc6e62..07d234207e 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -539,11 +539,11 @@ Variant::Type VisualScriptOperator::get_typed() const { void VisualScriptOperator::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_operator","op"),&VisualScriptOperator::set_operator); - ObjectTypeDB::bind_method(_MD("get_operator"),&VisualScriptOperator::get_operator); + ClassDB::bind_method(_MD("set_operator","op"),&VisualScriptOperator::set_operator); + ClassDB::bind_method(_MD("get_operator"),&VisualScriptOperator::get_operator); - ObjectTypeDB::bind_method(_MD("set_typed","type"),&VisualScriptOperator::set_typed); - ObjectTypeDB::bind_method(_MD("get_typed"),&VisualScriptOperator::get_typed); + ClassDB::bind_method(_MD("set_typed","type"),&VisualScriptOperator::set_typed); + ClassDB::bind_method(_MD("get_typed"),&VisualScriptOperator::get_typed); String types; for(int i=0;i<Variant::OP_MAX;i++) { @@ -717,8 +717,8 @@ void VisualScriptVariableGet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableGet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableGet::set_variable); - ObjectTypeDB::bind_method(_MD("get_variable"),&VisualScriptVariableGet::get_variable); + ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableGet::set_variable); + ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableGet::get_variable); ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); @@ -853,8 +853,8 @@ void VisualScriptVariableSet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableSet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableSet::set_variable); - ObjectTypeDB::bind_method(_MD("get_variable"),&VisualScriptVariableSet::get_variable); + ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableSet::set_variable); + ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableSet::get_variable); ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); @@ -995,11 +995,11 @@ void VisualScriptConstant::_validate_property(PropertyInfo& property) const { void VisualScriptConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); - ObjectTypeDB::bind_method(_MD("get_constant_type"),&VisualScriptConstant::get_constant_type); + ClassDB::bind_method(_MD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); + ClassDB::bind_method(_MD("get_constant_type"),&VisualScriptConstant::get_constant_type); - ObjectTypeDB::bind_method(_MD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); - ObjectTypeDB::bind_method(_MD("get_constant_value"),&VisualScriptConstant::get_constant_value); + ClassDB::bind_method(_MD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); + ClassDB::bind_method(_MD("get_constant_value"),&VisualScriptConstant::get_constant_value); String argt="Null"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -1078,7 +1078,7 @@ PropertyInfo VisualScriptPreload::get_output_value_port_info(int p_idx) const{ PropertyInfo pinfo=PropertyInfo(Variant::OBJECT,"res"); if (preload.is_valid()) { pinfo.hint=PROPERTY_HINT_RESOURCE_TYPE; - pinfo.hint_string=preload->get_type(); + pinfo.hint_string=preload->get_class(); } return pinfo; @@ -1098,7 +1098,7 @@ String VisualScriptPreload::get_text() const { } else if (preload->get_name()!=String()) { return preload->get_name(); } else { - return preload->get_type(); + return preload->get_class(); } } else { return "<empty>"; @@ -1123,8 +1123,8 @@ Ref<Resource> VisualScriptPreload::get_preload() const{ void VisualScriptPreload::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_preload","resource"),&VisualScriptPreload::set_preload); - ObjectTypeDB::bind_method(_MD("get_preload"),&VisualScriptPreload::get_preload); + ClassDB::bind_method(_MD("set_preload","resource"),&VisualScriptPreload::set_preload); + ClassDB::bind_method(_MD("get_preload"),&VisualScriptPreload::get_preload); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"resource",PROPERTY_HINT_RESOURCE_TYPE,"Resource"),_SCS("set_preload"),_SCS("get_preload")); @@ -1425,8 +1425,8 @@ VisualScriptNodeInstance* VisualScriptGlobalConstant::instance(VisualScriptInsta void VisualScriptGlobalConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); - ObjectTypeDB::bind_method(_MD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); + ClassDB::bind_method(_MD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); + ClassDB::bind_method(_MD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); String cc; @@ -1540,7 +1540,7 @@ public: VisualScriptNodeInstance* VisualScriptClassConstant::instance(VisualScriptInstance* p_instance) { VisualScriptNodeInstanceClassConstant * instance = memnew(VisualScriptNodeInstanceClassConstant ); - instance->value=ObjectTypeDB::get_integer_constant(base_type,name,&instance->valid); + instance->value=ClassDB::get_integer_constant(base_type,name,&instance->valid); return instance; } @@ -1549,7 +1549,7 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo& property) const if (property.name=="constant") { List<String> constants; - ObjectTypeDB::get_integer_constant_list(base_type,&constants,true); + ClassDB::get_integer_constant_list(base_type,&constants,true); property.hint_string=""; for(List<String>::Element *E=constants.front();E;E=E->next()) { @@ -1563,11 +1563,11 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo& property) const void VisualScriptClassConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); - ObjectTypeDB::bind_method(_MD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); + ClassDB::bind_method(_MD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); + ClassDB::bind_method(_MD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); - ObjectTypeDB::bind_method(_MD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptClassConstant::get_base_type); + ClassDB::bind_method(_MD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptClassConstant::get_base_type); ADD_PROPERTY(PropertyInfo(Variant::STRING,"base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),_SCS("set_class_constant"),_SCS("get_class_constant")); @@ -1703,11 +1703,11 @@ void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo& property) c void VisualScriptBasicTypeConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); - ObjectTypeDB::bind_method(_MD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); - ObjectTypeDB::bind_method(_MD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); + ClassDB::bind_method(_MD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); + ClassDB::bind_method(_MD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); String argt="Null"; @@ -1831,8 +1831,8 @@ VisualScriptNodeInstance* VisualScriptMathConstant::instance(VisualScriptInstanc void VisualScriptMathConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); - ObjectTypeDB::bind_method(_MD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); + ClassDB::bind_method(_MD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); + ClassDB::bind_method(_MD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); String cc; @@ -1943,7 +1943,7 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output TypeGuess tg; tg.type=Variant::OBJECT; if (obj) { - tg.obj_type=obj->get_type(); + tg.GDCLASS=obj->get_class(); tg.script=obj->get_script(); } @@ -1953,8 +1953,8 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output void VisualScriptEngineSingleton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); + ClassDB::bind_method(_MD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); + ClassDB::bind_method(_MD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); String cc; @@ -2117,7 +2117,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu VisualScriptSceneNode::TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="Node"; + tg.GDCLASS="Node"; #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); @@ -2146,7 +2146,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu Node* another = script_node->get_node(path); if (another) { - tg.obj_type=another->get_type(); + tg.GDCLASS=another->get_class(); tg.script=another->get_script(); } #endif @@ -2190,8 +2190,8 @@ void VisualScriptSceneNode::_validate_property(PropertyInfo& property) const { void VisualScriptSceneNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); - ObjectTypeDB::bind_method(_MD("get_node_path"),&VisualScriptSceneNode::get_node_path); + ClassDB::bind_method(_MD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); + ClassDB::bind_method(_MD("get_node_path"),&VisualScriptSceneNode::get_node_path); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_node_path"),_SCS("get_node_path")); } @@ -2296,7 +2296,7 @@ VisualScriptSceneTree::TypeGuess VisualScriptSceneTree::guess_output_type(TypeGu TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="SceneTree"; + tg.GDCLASS="SceneTree"; return tg; } @@ -2401,8 +2401,8 @@ VisualScriptNodeInstance* VisualScriptResourcePath::instance(VisualScriptInstanc void VisualScriptResourcePath::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); - ObjectTypeDB::bind_method(_MD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); + ClassDB::bind_method(_MD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); + ClassDB::bind_method(_MD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); ADD_PROPERTY(PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE),_SCS("set_resource_path"),_SCS("get_resource_path")); } @@ -2494,13 +2494,13 @@ VisualScriptSelf::TypeGuess VisualScriptSelf::guess_output_type(TypeGuess* p_inp VisualScriptSceneNode::TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="Object"; + tg.GDCLASS="Object"; Ref<Script> script = get_visual_script(); if (!script.is_valid()) return tg; - tg.obj_type=script->get_instance_base_type(); + tg.GDCLASS=script->get_instance_base_type(); tg.script=script; return tg; @@ -2817,7 +2817,7 @@ String VisualScriptSubCall::get_text() const { return script->get_name(); if (script->get_path().is_resource_file()) return script->get_path().get_file(); - return script->get_type(); + return script->get_class(); } return ""; } @@ -3001,14 +3001,14 @@ VisualScriptNodeInstance* VisualScriptComment::instance(VisualScriptInstance* p_ void VisualScriptComment::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_title","title"),&VisualScriptComment::set_title); - ObjectTypeDB::bind_method(_MD("get_title"),&VisualScriptComment::get_title); + ClassDB::bind_method(_MD("set_title","title"),&VisualScriptComment::set_title); + ClassDB::bind_method(_MD("get_title"),&VisualScriptComment::get_title); - ObjectTypeDB::bind_method(_MD("set_description","description"),&VisualScriptComment::set_description); - ObjectTypeDB::bind_method(_MD("get_description"),&VisualScriptComment::get_description); + ClassDB::bind_method(_MD("set_description","description"),&VisualScriptComment::set_description); + ClassDB::bind_method(_MD("get_description"),&VisualScriptComment::get_description); - ObjectTypeDB::bind_method(_MD("set_size","size"),&VisualScriptComment::set_size); - ObjectTypeDB::bind_method(_MD("get_size"),&VisualScriptComment::get_size); + ClassDB::bind_method(_MD("set_size","size"),&VisualScriptComment::set_size); + ClassDB::bind_method(_MD("get_size"),&VisualScriptComment::get_size); ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); ADD_PROPERTY( PropertyInfo(Variant::STRING,"description",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_description"),_SCS("get_description")); @@ -3140,11 +3140,11 @@ VisualScriptNodeInstance* VisualScriptConstructor::instance(VisualScriptInstance void VisualScriptConstructor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); - ObjectTypeDB::bind_method(_MD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); + ClassDB::bind_method(_MD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); + ClassDB::bind_method(_MD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); - ObjectTypeDB::bind_method(_MD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); - ObjectTypeDB::bind_method(_MD("get_constructor"),&VisualScriptConstructor::get_constructor); + ClassDB::bind_method(_MD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); + ClassDB::bind_method(_MD("get_constructor"),&VisualScriptConstructor::get_constructor); ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor_type"),_SCS("get_constructor_type")); ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"constructor",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor"),_SCS("get_constructor")); @@ -3283,11 +3283,11 @@ VisualScriptNodeInstance* VisualScriptLocalVar::instance(VisualScriptInstance* p void VisualScriptLocalVar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); - ObjectTypeDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVar::get_var_name); + ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); + ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVar::get_var_name); - ObjectTypeDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); - ObjectTypeDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVar::get_var_type); + ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); + ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVar::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -3420,11 +3420,11 @@ VisualScriptNodeInstance* VisualScriptLocalVarSet::instance(VisualScriptInstance void VisualScriptLocalVarSet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); - ObjectTypeDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); + ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); + ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); - ObjectTypeDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); - ObjectTypeDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); + ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); + ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -3630,11 +3630,11 @@ void VisualScriptInputAction::_validate_property(PropertyInfo& property) const { void VisualScriptInputAction::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_action_name","name"),&VisualScriptInputAction::set_action_name); - ObjectTypeDB::bind_method(_MD("get_action_name"),&VisualScriptInputAction::get_action_name); + ClassDB::bind_method(_MD("set_action_name","name"),&VisualScriptInputAction::set_action_name); + ClassDB::bind_method(_MD("get_action_name"),&VisualScriptInputAction::get_action_name); - ObjectTypeDB::bind_method(_MD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); - ObjectTypeDB::bind_method(_MD("get_action_mode"),&VisualScriptInputAction::get_action_mode); + ClassDB::bind_method(_MD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); + ClassDB::bind_method(_MD("get_action_mode"),&VisualScriptInputAction::get_action_mode); ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),_SCS("set_action_name"),_SCS("get_action_name")); ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Pressed,Released,JustPressed,JustReleased"),_SCS("set_action_mode"),_SCS("get_action_mode")); @@ -3834,14 +3834,14 @@ void VisualScriptDeconstruct::_validate_property(PropertyInfo& property) const { void VisualScriptDeconstruct::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); - ObjectTypeDB::bind_method(_MD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); + ClassDB::bind_method(_MD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); + ClassDB::bind_method(_MD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); - ObjectTypeDB::bind_method(_MD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); - ObjectTypeDB::bind_method(_MD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); + ClassDB::bind_method(_MD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); + ClassDB::bind_method(_MD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); - ObjectTypeDB::bind_method(_MD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); - ObjectTypeDB::bind_method(_MD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); + ClassDB::bind_method(_MD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); + ClassDB::bind_method(_MD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 94eeadca57..eb70c86637 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -5,7 +5,7 @@ class VisualScriptFunction : public VisualScriptNode { - OBJ_TYPE(VisualScriptFunction,VisualScriptNode) + GDCLASS(VisualScriptFunction,VisualScriptNode) struct Argument { @@ -72,7 +72,7 @@ public: class VisualScriptOperator : public VisualScriptNode { - OBJ_TYPE(VisualScriptOperator,VisualScriptNode) + GDCLASS(VisualScriptOperator,VisualScriptNode) Variant::Type typed; @@ -114,7 +114,7 @@ public: class VisualScriptVariableGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptVariableGet,VisualScriptNode) + GDCLASS(VisualScriptVariableGet,VisualScriptNode) StringName variable; @@ -153,7 +153,7 @@ public: class VisualScriptVariableSet : public VisualScriptNode { - OBJ_TYPE(VisualScriptVariableSet,VisualScriptNode) + GDCLASS(VisualScriptVariableSet,VisualScriptNode) StringName variable; @@ -192,7 +192,7 @@ public: class VisualScriptConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptConstant,VisualScriptNode) + GDCLASS(VisualScriptConstant,VisualScriptNode) Variant::Type type; @@ -236,7 +236,7 @@ public: class VisualScriptPreload : public VisualScriptNode { - OBJ_TYPE(VisualScriptPreload,VisualScriptNode) + GDCLASS(VisualScriptPreload,VisualScriptNode) Ref<Resource> preload; @@ -274,7 +274,7 @@ public: class VisualScriptIndexGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptIndexGet,VisualScriptNode) + GDCLASS(VisualScriptIndexGet,VisualScriptNode) public: @@ -305,7 +305,7 @@ public: class VisualScriptIndexSet : public VisualScriptNode { - OBJ_TYPE(VisualScriptIndexSet,VisualScriptNode) + GDCLASS(VisualScriptIndexSet,VisualScriptNode) public: @@ -337,7 +337,7 @@ public: class VisualScriptGlobalConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptGlobalConstant,VisualScriptNode) + GDCLASS(VisualScriptGlobalConstant,VisualScriptNode) int index; @@ -373,7 +373,7 @@ public: class VisualScriptClassConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptClassConstant,VisualScriptNode) + GDCLASS(VisualScriptClassConstant,VisualScriptNode) StringName base_type; StringName name; @@ -414,7 +414,7 @@ public: class VisualScriptBasicTypeConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptBasicTypeConstant,VisualScriptNode) + GDCLASS(VisualScriptBasicTypeConstant,VisualScriptNode) Variant::Type type; StringName name; @@ -457,7 +457,7 @@ public: class VisualScriptMathConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptMathConstant,VisualScriptNode) + GDCLASS(VisualScriptMathConstant,VisualScriptNode) public: enum MathConstant { @@ -508,7 +508,7 @@ VARIANT_ENUM_CAST( VisualScriptMathConstant::MathConstant ) class VisualScriptEngineSingleton : public VisualScriptNode { - OBJ_TYPE(VisualScriptEngineSingleton,VisualScriptNode) + GDCLASS(VisualScriptEngineSingleton,VisualScriptNode) String singleton; @@ -549,7 +549,7 @@ public: class VisualScriptSceneNode : public VisualScriptNode { - OBJ_TYPE(VisualScriptSceneNode,VisualScriptNode) + GDCLASS(VisualScriptSceneNode,VisualScriptNode) NodePath path; protected: @@ -590,7 +590,7 @@ public: class VisualScriptSceneTree : public VisualScriptNode { - OBJ_TYPE(VisualScriptSceneTree,VisualScriptNode) + GDCLASS(VisualScriptSceneTree,VisualScriptNode) protected: @@ -627,7 +627,7 @@ public: class VisualScriptResourcePath : public VisualScriptNode { - OBJ_TYPE(VisualScriptResourcePath,VisualScriptNode) + GDCLASS(VisualScriptResourcePath,VisualScriptNode) String path; protected: @@ -664,7 +664,7 @@ public: class VisualScriptSelf : public VisualScriptNode { - OBJ_TYPE(VisualScriptSelf,VisualScriptNode) + GDCLASS(VisualScriptSelf,VisualScriptNode) protected: @@ -701,7 +701,7 @@ public: class VisualScriptCustomNode: public VisualScriptNode { - OBJ_TYPE(VisualScriptCustomNode,VisualScriptNode) + GDCLASS(VisualScriptCustomNode,VisualScriptNode) protected: @@ -752,7 +752,7 @@ public: class VisualScriptSubCall: public VisualScriptNode { - OBJ_TYPE(VisualScriptSubCall,VisualScriptNode) + GDCLASS(VisualScriptSubCall,VisualScriptNode) protected: @@ -785,7 +785,7 @@ public: class VisualScriptComment: public VisualScriptNode { - OBJ_TYPE(VisualScriptComment,VisualScriptNode) + GDCLASS(VisualScriptComment,VisualScriptNode) String title; @@ -829,7 +829,7 @@ public: class VisualScriptConstructor: public VisualScriptNode { - OBJ_TYPE(VisualScriptConstructor,VisualScriptNode) + GDCLASS(VisualScriptConstructor,VisualScriptNode) Variant::Type type; @@ -874,7 +874,7 @@ public: class VisualScriptLocalVar: public VisualScriptNode { - OBJ_TYPE(VisualScriptLocalVar,VisualScriptNode) + GDCLASS(VisualScriptLocalVar,VisualScriptNode) StringName name; Variant::Type type; @@ -914,7 +914,7 @@ public: class VisualScriptLocalVarSet: public VisualScriptNode { - OBJ_TYPE(VisualScriptLocalVarSet,VisualScriptNode) + GDCLASS(VisualScriptLocalVarSet,VisualScriptNode) StringName name; Variant::Type type; @@ -956,7 +956,7 @@ public: class VisualScriptInputAction: public VisualScriptNode { - OBJ_TYPE(VisualScriptInputAction,VisualScriptNode) + GDCLASS(VisualScriptInputAction,VisualScriptNode) public: enum Mode { MODE_PRESSED, @@ -1007,7 +1007,7 @@ VARIANT_ENUM_CAST( VisualScriptInputAction::Mode ) class VisualScriptDeconstruct: public VisualScriptNode { - OBJ_TYPE(VisualScriptDeconstruct,VisualScriptNode) + GDCLASS(VisualScriptDeconstruct,VisualScriptNode) struct Element { diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 221c46b6fd..8b251e667c 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -157,11 +157,11 @@ void VisualScriptYield::_validate_property(PropertyInfo& property) const { void VisualScriptYield::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); - ObjectTypeDB::bind_method(_MD("get_yield_mode"),&VisualScriptYield::get_yield_mode); + ClassDB::bind_method(_MD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); + ClassDB::bind_method(_MD("get_yield_mode"),&VisualScriptYield::get_yield_mode); - ObjectTypeDB::bind_method(_MD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); - ObjectTypeDB::bind_method(_MD("get_wait_time"),&VisualScriptYield::get_wait_time); + ClassDB::bind_method(_MD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); + ClassDB::bind_method(_MD("get_wait_time"),&VisualScriptYield::get_wait_time); ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Frame,FixedFrame,Time",PROPERTY_USAGE_NOEDITOR),_SCS("set_yield_mode"),_SCS("get_yield_mode")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"wait_time"),_SCS("set_wait_time"),_SCS("get_wait_time")); @@ -270,7 +270,7 @@ StringName VisualScriptYieldSignal::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -290,7 +290,7 @@ int VisualScriptYieldSignal::get_output_value_port_count() const{ MethodInfo sr; - if (!ObjectTypeDB::get_signal(_get_base_type(),signal,&sr)) + if (!ClassDB::get_signal(_get_base_type(),signal,&sr)) return 0; return sr.arguments.size(); @@ -315,7 +315,7 @@ PropertyInfo VisualScriptYieldSignal::get_output_value_port_info(int p_idx) cons MethodInfo sr; - if (!ObjectTypeDB::get_signal(_get_base_type(),signal,&sr)) + if (!ClassDB::get_signal(_get_base_type(),signal,&sr)) return PropertyInfo(); //no signal ERR_FAIL_INDEX_V(p_idx,sr.arguments.size(),PropertyInfo()); return sr.arguments[p_idx]; @@ -440,7 +440,7 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { List<MethodInfo> methods; - ObjectTypeDB::get_signal_list(_get_base_type(),&methods); + ClassDB::get_signal_list(_get_base_type(),&methods); List<String> mstring; for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { @@ -468,17 +468,17 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { void VisualScriptYieldSignal::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptYieldSignal::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptYieldSignal::get_base_type); - ObjectTypeDB::bind_method(_MD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); - ObjectTypeDB::bind_method(_MD("get_signal"),&VisualScriptYieldSignal::get_signal); + ClassDB::bind_method(_MD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); + ClassDB::bind_method(_MD("get_signal"),&VisualScriptYieldSignal::get_signal); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptYieldSignal::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptYieldSignal::get_base_path); diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h index ae7f8c15c1..210d6ec995 100644 --- a/modules/visual_script/visual_script_yield_nodes.h +++ b/modules/visual_script/visual_script_yield_nodes.h @@ -5,7 +5,7 @@ class VisualScriptYield : public VisualScriptNode { - OBJ_TYPE(VisualScriptYield,VisualScriptNode) + GDCLASS(VisualScriptYield,VisualScriptNode) public: enum YieldMode { @@ -60,7 +60,7 @@ VARIANT_ENUM_CAST( VisualScriptYield::YieldMode ) class VisualScriptYieldSignal : public VisualScriptNode { - OBJ_TYPE(VisualScriptYieldSignal,VisualScriptNode) + GDCLASS(VisualScriptYieldSignal,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index adeef6cc36..bc2bfa2ae6 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -38,7 +38,7 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback { - OBJ_TYPE(AudioStreamPlaybackOGGVorbis,AudioStreamPlayback); + GDCLASS(AudioStreamPlaybackOGGVorbis,AudioStreamPlayback); enum { MIN_MIX=1024 @@ -115,7 +115,7 @@ public: class AudioStreamOGGVorbis : public AudioStream { - OBJ_TYPE(AudioStreamOGGVorbis,AudioStream); + GDCLASS(AudioStreamOGGVorbis,AudioStream); String file; public: diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp index d339462493..de929d9350 100644 --- a/modules/vorbis/register_types.cpp +++ b/modules/vorbis/register_types.cpp @@ -36,7 +36,7 @@ void register_vorbis_types() { vorbis_stream_loader = memnew( ResourceFormatLoaderAudioStreamOGGVorbis ); ResourceLoader::add_resource_format_loader(vorbis_stream_loader); - ObjectTypeDB::register_type<AudioStreamOGGVorbis>(); + ClassDB::register_class<AudioStreamOGGVorbis>(); } void unregister_vorbis_types() { diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp index 97794941cc..e50eb337ae 100644 --- a/modules/webm/register_types.cpp +++ b/modules/webm/register_types.cpp @@ -36,7 +36,7 @@ void register_webm_types() { webm_stream_loader = memnew(ResourceFormatLoaderVideoStreamWebm); ResourceLoader::add_resource_format_loader(webm_stream_loader); - ObjectTypeDB::register_type<VideoStreamWebm>(); + ClassDB::register_class<VideoStreamWebm>(); } void unregister_webm_types() { diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index 83f0b6af09..a34591d9b9 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -36,7 +36,7 @@ class OpusVorbisDecoder; class VideoStreamPlaybackWebm : public VideoStreamPlayback { - OBJ_TYPE(VideoStreamPlaybackWebm, VideoStreamPlayback) + GDCLASS(VideoStreamPlaybackWebm, VideoStreamPlayback) String file_name; int audio_track; @@ -102,7 +102,7 @@ private: class VideoStreamWebm : public VideoStream { - OBJ_TYPE(VideoStreamWebm, VideoStream) + GDCLASS(VideoStreamWebm, VideoStream) String file; int audio_track; |