From 118eed485e8f928a5a0dab530ae93211afa10525 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 2 Jan 2017 23:03:46 -0300 Subject: 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() --- modules/chibi/event_stream_chibi.cpp | 2 +- modules/chibi/event_stream_chibi.h | 4 +- modules/dds/texture_loader_dds.cpp | 2 +- modules/enet/networked_multiplayer_enet.cpp | 12 +- modules/enet/networked_multiplayer_enet.h | 2 +- modules/enet/register_types.cpp | 2 +- modules/etc1/texture_loader_pkm.cpp | 2 +- modules/gdscript/gd_compiler.cpp | 4 +- modules/gdscript/gd_editor.cpp | 110 +++++++-------- modules/gdscript/gd_function.cpp | 16 +-- modules/gdscript/gd_function.h | 2 +- modules/gdscript/gd_functions.cpp | 2 +- modules/gdscript/gd_parser.cpp | 4 +- modules/gdscript/gd_script.cpp | 18 +-- modules/gdscript/gd_script.h | 4 +- modules/gdscript/register_types.cpp | 6 +- modules/gridmap/grid_map.cpp | 80 +++++------ modules/gridmap/grid_map.h | 2 +- modules/gridmap/grid_map_editor_plugin.cpp | 20 +-- modules/gridmap/grid_map_editor_plugin.h | 4 +- modules/gridmap/register_types.cpp | 2 +- modules/mpc/audio_stream_mpc.cpp | 4 +- modules/mpc/audio_stream_mpc.h | 4 +- modules/mpc/register_types.cpp | 2 +- modules/openssl/register_types.cpp | 2 +- modules/opus/audio_stream_opus.h | 4 +- modules/opus/register_types.cpp | 2 +- modules/pvr/texture_loader_pvr.cpp | 2 +- modules/regex/regex.cpp | 32 ++--- modules/regex/regex.h | 4 +- modules/regex/register_types.cpp | 4 +- modules/theora/register_types.cpp | 2 +- modules/theora/video_stream_theora.h | 4 +- modules/visual_script/register_types.cpp | 104 +++++++------- modules/visual_script/visual_script.cpp | 136 +++++++++--------- modules/visual_script/visual_script.h | 8 +- .../visual_script/visual_script_builtin_funcs.cpp | 6 +- .../visual_script/visual_script_builtin_funcs.h | 2 +- modules/visual_script/visual_script_editor.cpp | 132 +++++++++--------- modules/visual_script/visual_script_editor.h | 2 +- modules/visual_script/visual_script_expression.h | 2 +- .../visual_script/visual_script_flow_control.cpp | 22 +-- modules/visual_script/visual_script_flow_control.h | 16 +-- modules/visual_script/visual_script_func_nodes.cpp | 152 ++++++++++----------- modules/visual_script/visual_script_func_nodes.h | 8 +- modules/visual_script/visual_script_nodes.cpp | 142 +++++++++---------- modules/visual_script/visual_script_nodes.h | 50 +++---- .../visual_script/visual_script_yield_nodes.cpp | 32 ++--- modules/visual_script/visual_script_yield_nodes.h | 4 +- modules/vorbis/audio_stream_ogg_vorbis.h | 4 +- modules/vorbis/register_types.cpp | 2 +- modules/webm/register_types.cpp | 2 +- modules/webm/video_stream_webm.h | 4 +- 53 files changed, 598 insertions(+), 598 deletions(-) (limited to 'modules') 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(); + ClassDB::register_class(); 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 *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(); + ClassDB::register_class(); } 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 *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 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()) { - // t.obj_type=obj->cast_to()->get_name(); + // t.GDCLASS=obj->cast_to()->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(); 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 vmethods; - ObjectTypeDB::get_virtual_methods(id.obj_type,&vmethods); + ClassDB::get_virtual_methods(id.GDCLASS,&vmethods); for (List::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 constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } List methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List::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 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 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 methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List::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 constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } List methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List::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(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 gdn = t.value; if (gdn.is_valid()) { StringName cn = gdn->get_name(); List cnames; - ObjectTypeDB::get_integer_constant_list(cn,&cnames); + ClassDB::get_integer_constant_list(cn,&cnames); for (List::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 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 mi; - ObjectTypeDB::get_method_list(t.obj_type,&mi); + ClassDB::get_method_list(t.GDCLASS,&mi); for (List::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 vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.GDCLASS,&vm); for(List::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 sigs; - ObjectTypeDB::get_signal_list(t.obj_type,&sigs); + ClassDB::get_signal_list(t.GDCLASS,&sigs); for (List::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(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 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 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 vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.GDCLASS,&vm); for(List::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 *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 class_list; - ObjectTypeDB::get_type_list(&class_list); + ClassDB::get_class_list(&class_list); for(List::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(); - ObjectTypeDB::register_virtual_type(); + ClassDB::register_class(); + ClassDB::register_virtual_class(); 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(); + ClassDB::register_class(); #ifdef TOOLS_ENABLED EditorPlugins::add_by_type(); #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(); + ClassDB::register_class(); } 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(); + ClassDB::register_class(); 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(); + ClassDB::register_class(); } 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 *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 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(); - ObjectTypeDB::register_type(); + ClassDB::register_class(); + ClassDB::register_class(); } 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(); + ClassDB::register_class(); } 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(); - ObjectTypeDB::register_virtual_type(); - ObjectTypeDB::register_virtual_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - - - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); -// ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - - ObjectTypeDB::register_type(); - ObjectTypeDB::register_type(); - - ObjectTypeDB::register_type(); - - - ObjectTypeDB::register_type(); + ClassDB::register_class(); + ClassDB::register_virtual_class(); + ClassDB::register_virtual_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + + + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); +// ClassDB::register_type(); + ClassDB::register_class(); + + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + + ClassDB::register_class(); + ClassDB::register_class(); + + ClassDB::register_class(); + + + ClassDB::register_class(); 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