diff --git a/data/atlases/character_atlas.h b/data/atlases/character_atlas.h index 35ba9bf..ccc14ba 100644 --- a/data/atlases/character_atlas.h +++ b/data/atlases/character_atlas.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class CharacterAtlas : public Resource { GDCLASS(CharacterAtlas, Resource); diff --git a/data/atlases/character_atlas_entry.h b/data/atlases/character_atlas_entry.h index 3e91bfb..053b896 100644 --- a/data/atlases/character_atlas_entry.h +++ b/data/atlases/character_atlas_entry.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class CharacterAtlasEntry : public Resource { GDCLASS(CharacterAtlasEntry, Resource); diff --git a/data/auras/aura_group.h b/data/auras/aura_group.h index a641ad8..7654fa1 100644 --- a/data/auras/aura_group.h +++ b/data/auras/aura_group.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class AuraGroup : public Resource { GDCLASS(AuraGroup, Resource); diff --git a/data/items/craft_recipe.h b/data/items/craft_recipe.h index 52173e3..0bb880f 100644 --- a/data/items/craft_recipe.h +++ b/data/items/craft_recipe.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + #include "item_template.h" diff --git a/data/items/craft_recipe_helper.h b/data/items/craft_recipe_helper.h index e410050..989ea57 100644 --- a/data/items/craft_recipe_helper.h +++ b/data/items/craft_recipe_helper.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "item_template.h" diff --git a/data/items/equipment_data.h b/data/items/equipment_data.h index 67820f7..2ad8583 100644 --- a/data/items/equipment_data.h +++ b/data/items/equipment_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class ItemInstance; class ItemTemplate; diff --git a/data/items/item_instance.cpp b/data/items/item_instance.cpp index 4a06dec..c48752a 100644 --- a/data/items/item_instance.cpp +++ b/data/items/item_instance.cpp @@ -98,7 +98,7 @@ void ItemInstance::add_item_stat_modifier(const int stat_id, const int base_mod, void ItemInstance::remove_item_stat_modifier(const int index) { ERR_FAIL_INDEX(index, _modifiers.size()); - _modifiers.remove(index); + _modifiers.remove_at(index); } void ItemInstance::clear_item_stat_modifiers() { _modifiers.clear(); @@ -197,11 +197,8 @@ Dictionary ItemInstance::_to_dict() { return dict; } void ItemInstance::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _item_template_path = dict.get("item_path", 0); @@ -271,12 +268,12 @@ void ItemInstance::_bind_methods() { ClassDB::bind_method(D_METHOD("stat_modifiers_set", "mods"), &ItemInstance::stat_modifiers_set); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "stat_modifiers", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT, ""), "stat_modifiers_set", "stat_modifiers_get"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_get_description")); + GDVIRTUAL_BIND("_get_description", "desc"); ClassDB::bind_method(D_METHOD("get_description"), &ItemInstance::get_description); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict", "dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &ItemInstance::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &ItemInstance::to_dict); diff --git a/data/items/item_instance.h b/data/items/item_instance.h index 659aca3..6945785 100644 --- a/data/items/item_instance.h +++ b/data/items/item_instance.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "../../item_enums.h" diff --git a/data/items/item_template.cpp b/data/items/item_template.cpp index 61d25d6..e02b98d 100644 --- a/data/items/item_template.cpp +++ b/data/items/item_template.cpp @@ -377,7 +377,7 @@ Ref ItemTemplate::create_item_instance() { } Ref item; - item.instance(); + item.instantiate(); //todo setup //ERR_EXPLAIN("NOT YET IMPLEMENTED!"); @@ -441,7 +441,7 @@ void ItemTemplate::_validate_property(PropertyInfo &property) const { } void ItemTemplate::_bind_methods() { - BIND_VMETHOD(MethodInfo("_create_item_instance")); + GDVIRTUAL_BIND("_create_item_instance"); ClassDB::bind_method(D_METHOD("create_item_instance"), &ItemTemplate::create_item_instance); @@ -568,7 +568,7 @@ void ItemTemplate::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text_translation_key", "value"), &ItemTemplate::set_text_translation_key); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_translation_key"), "set_text_translation_key", "get_text_translation_key"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_get_description")); + GDVIRTUAL_BIND("_get_description"); ClassDB::bind_method(D_METHOD("get_description"), &ItemTemplate::get_description); //StatMods Property binds diff --git a/data/items/item_template.h b/data/items/item_template.h index e03b202..93339e2 100644 --- a/data/items/item_template.h +++ b/data/items/item_template.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "scene/resources/texture.h" diff --git a/data/items/model_visual.cpp b/data/items/model_visual.cpp index db85a0f..56d8c39 100644 --- a/data/items/model_visual.cpp +++ b/data/items/model_visual.cpp @@ -51,7 +51,7 @@ void ModelVisual::add_visual_entry(const Ref visual_entry) { void ModelVisual::remove_visual_entry(const int index) { ERR_FAIL_INDEX(index, _visual_entries.size()); - _visual_entries.remove(index); + _visual_entries.remove_at(index); } int ModelVisual::get_visual_entry_count() const { diff --git a/data/items/model_visual.h b/data/items/model_visual.h index fd4c9f3..c1c96ea 100644 --- a/data/items/model_visual.h +++ b/data/items/model_visual.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "../../item_enums.h" #include "model_visual_entry.h" diff --git a/data/items/model_visual_entry.cpp b/data/items/model_visual_entry.cpp index 49f6dd5..f0d6573 100644 --- a/data/items/model_visual_entry.cpp +++ b/data/items/model_visual_entry.cpp @@ -106,12 +106,12 @@ void ModelVisualEntry::set_attachment(const int index, const Ref &a _entries.write[index].attachment = attachment; } -Transform ModelVisualEntry::get_transform(const int index) const { - ERR_FAIL_INDEX_V(index, _entries.size(), Transform()); +Transform3D ModelVisualEntry::get_transform(const int index) const { + ERR_FAIL_INDEX_V(index, _entries.size(), Transform3D()); return _entries[index].transform; } -void ModelVisualEntry::set_transform(const int index, const Transform &transform) { +void ModelVisualEntry::set_transform(const int index, const Transform3D &transform) { ERR_FAIL_INDEX(index, _entries.size()); _entries.write[index].transform = transform; @@ -228,7 +228,7 @@ void ModelVisualEntry::_get_property_list(List *p_list) const { } else { p_list->push_back(PropertyInfo(Variant::OBJECT, "entry_" + itos(i) + "/attachment", PROPERTY_HINT_RESOURCE_TYPE, "PackedScene", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL)); } - p_list->push_back(PropertyInfo(Variant::TRANSFORM, "entry_" + itos(i) + "/transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::TRANSFORM3D, "entry_" + itos(i) + "/transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL)); } } diff --git a/data/items/model_visual_entry.h b/data/items/model_visual_entry.h index 6e85f0f..10ae84f 100644 --- a/data/items/model_visual_entry.h +++ b/data/items/model_visual_entry.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/string/ustring.h" #include "core/math/color.h" -#else -#include "core/resource.h" -#include "core/ustring.h" -#include "core/color.h" -#endif + #include "scene/resources/texture.h" @@ -88,8 +83,8 @@ public: Ref get_attachment(const int index); void set_attachment(const int index, const Ref &attachment); - Transform get_transform(const int index) const; - void set_transform(const int index, const Transform &transform); + Transform3D get_transform(const int index) const; + void set_transform(const int index, const Transform3D &transform); int get_size() const; void set_size(const int value); @@ -106,7 +101,7 @@ protected: Color color; Ref attachment; - Transform transform; + Transform3D transform; MVEE() { color = Color(1, 1, 1, 1); diff --git a/data/loot/loot_data_base.cpp b/data/loot/loot_data_base.cpp index 1ecdd43..42aec02 100644 --- a/data/loot/loot_data_base.cpp +++ b/data/loot/loot_data_base.cpp @@ -278,7 +278,7 @@ void LootDataBase::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item", "index"), &LootDataBase::get_item); ClassDB::bind_method(D_METHOD("set_item", "index", "value"), &LootDataBase::set_item); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::ARRAY, "arr"), "_get_loot")); + GDVIRTUAL_BIND("_get_loot"); ClassDB::bind_method(D_METHOD("get_loot"), &LootDataBase::get_loot); ClassDB::bind_method(D_METHOD("_get_loot"), &LootDataBase::_get_loot); diff --git a/data/loot/loot_data_base.h b/data/loot/loot_data_base.h index 6da9d35..55548e7 100644 --- a/data/loot/loot_data_base.h +++ b/data/loot/loot_data_base.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/templates/vector.h" #include "core/variant/array.h" -#else -#include "core/vector.h" -#include "core/array.h" -#endif + #include "../items/item_template.h" diff --git a/data/species/entity_species_data.cpp b/data/species/entity_species_data.cpp index 1e92e93..3eece9d 100644 --- a/data/species/entity_species_data.cpp +++ b/data/species/entity_species_data.cpp @@ -67,7 +67,7 @@ void EntitySpeciesData::add_model_data(const Ref &model_data) void EntitySpeciesData::remove_model_data(const int index) { ERR_FAIL_INDEX(index, _model_datas.size()); - _model_datas.remove(index); + _model_datas.remove_at(index); } int EntitySpeciesData::get_model_data_count() const { @@ -99,7 +99,7 @@ void EntitySpeciesData::add_spell(const Ref &spell) { void EntitySpeciesData::remove_spell(const int index) { ERR_FAIL_INDEX(index, _spells.size()); - _spells.remove(index); + _spells.remove_at(index); } int EntitySpeciesData::get_spell_count() const { @@ -131,7 +131,7 @@ void EntitySpeciesData::add_aura(const Ref &aura) { void EntitySpeciesData::remove_aura(const int index) { ERR_FAIL_INDEX(index, _auras.size()); - _auras.remove(index); + _auras.remove_at(index); } int EntitySpeciesData::get_aura_count() const { @@ -176,7 +176,7 @@ void EntitySpeciesData::_validate_property(PropertyInfo &property) const { } void EntitySpeciesData::_bind_methods() { - BIND_VMETHOD(MethodInfo(Variant::STRING, "_generate_name", PropertyInfo(Variant::INT, "seed"))); + GDVIRTUAL_BIND("_generate_name", "seed"); ClassDB::bind_method(D_METHOD("generate_name"), &EntitySpeciesData::generate_name); diff --git a/data/species/entity_species_data.h b/data/species/entity_species_data.h index 388bd94..0f2c4b8 100644 --- a/data/species/entity_species_data.h +++ b/data/species/entity_species_data.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + #include "../../entity_enums.h" diff --git a/data/species/species_instance.cpp b/data/species/species_instance.cpp index 1d4e402..51399f9 100644 --- a/data/species/species_instance.cpp +++ b/data/species/species_instance.cpp @@ -115,11 +115,8 @@ Dictionary SpeciesInstance::_to_dict() { return dict; } void SpeciesInstance::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _id = dict.get("id", 0); set_species_path(dict.get("species_path", "")); @@ -171,8 +168,8 @@ void SpeciesInstance::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "head_index"), "set_head_index", "get_head_index"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &SpeciesInstance::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &SpeciesInstance::to_dict); diff --git a/data/species/species_instance.h b/data/species/species_instance.h index 5586f9b..4ce8ab1 100644 --- a/data/species/species_instance.h +++ b/data/species/species_instance.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "../items/model_visual_entry.h" diff --git a/data/species/species_model_data.cpp b/data/species/species_model_data.cpp index 5a76015..f2897b7 100644 --- a/data/species/species_model_data.cpp +++ b/data/species/species_model_data.cpp @@ -27,11 +27,8 @@ SOFTWARE. #include "../../defines.h" #include "../../singletons/ess.h" -#if VERSION_MAJOR > 3 #include "core/string/ustring.h" -#else -#include "core/ustring.h" -#endif + int SpeciesModelData::get_id() { @@ -73,7 +70,7 @@ void SpeciesModelData::add_visual(const Ref &visual) { void SpeciesModelData::remove_visual(const int index) { ERR_FAIL_INDEX(index, _visuals.size()); - _visuals.remove(index); + _visuals.remove_at(index); } int SpeciesModelData::get_visual_count() const { @@ -123,7 +120,7 @@ void SpeciesModelData::remove_customizable_slot_entry(const int slot_index, cons ERR_FAIL_INDEX(slot_index, _customizable_slots.size()); ERR_FAIL_INDEX(index, _customizable_slots.size()); - _customizable_slots.write[slot_index].remove(index); + _customizable_slots.write[slot_index].remove_at(index); } int SpeciesModelData::get_customizable_slot_count() const { @@ -196,7 +193,7 @@ void SpeciesModelData::remove_color_customizable_slot_color(const int slot_index ERR_FAIL_INDEX(slot_index, _customizable_color_slots.size()); ERR_FAIL_INDEX(index, _customizable_color_slots.size()); - _customizable_color_slots.write[slot_index].colors.remove(index); + _customizable_color_slots.write[slot_index].colors.remove_at(index); } Vector SpeciesModelData::get_color_customizable_slot_colors(const int slot_index) const { diff --git a/data/species/species_model_data.h b/data/species/species_model_data.h index 650be2d..269a8be 100644 --- a/data/species/species_model_data.h +++ b/data/species/species_model_data.h @@ -25,17 +25,11 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" #include "core/math/color.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#include "core/color.h" -#endif + #include "scene/resources/packed_scene.h" diff --git a/data/spells/spell.cpp b/data/spells/spell.cpp index 025566d..94e554b 100644 --- a/data/spells/spell.cpp +++ b/data/spells/spell.cpp @@ -1886,7 +1886,7 @@ void Spell::_handle_spell_heal(Ref data) { void Spell::_handle_projectile(Ref info) { if (_projectile_scene.is_valid()) { - Node *projectile = _projectile_scene->instance(); + Node *projectile = _projectile_scene->instantiate(); Node *p = info->caster_get()->get_parent(); @@ -1927,7 +1927,7 @@ void Spell::_handle_effect(Ref info) { if (_damage_enabled && has_target) { Ref sdi; - sdi.instance(); + sdi.instantiate(); sdi->spell_source_set(Ref(this)); sdi->dealer_set(info->caster_get()); @@ -1950,7 +1950,7 @@ void Spell::_handle_effect(Ref info) { } Ref aai; - aai.instance(); + aai.instantiate(); aai->caster_set(info->caster_get()); aai->target_set(info->target_get()); @@ -1968,7 +1968,7 @@ void Spell::_handle_effect(Ref info) { } Ref sci; - sci.instance(); + sci.instantiate(); sci->caster_set(info->caster_get()); sci->target_set(info->caster_get()); @@ -1989,7 +1989,7 @@ void Spell::_handle_effect(Ref info) { } Ref sci; - sci.instance(); + sci.instantiate(); sci->caster_set(info->caster_get()); sci->target_set(info->target_get()); @@ -2009,7 +2009,7 @@ void Spell::_aura_sapply(Ref info) { Ref ad = info->target_get()->aura_gets_by(info->caster_get(), _id); if (!ad.is_valid()) { - ad.instance(); + ad.instantiate(); setup_aura_data(ad, info); @@ -2348,10 +2348,10 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("cast_interrupts", "info"), &Spell::cast_interrupts); ClassDB::bind_method(D_METHOD("cast_finishs", "info"), &Spell::cast_finishs); - BIND_VMETHOD(MethodInfo("_cast_starts", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_cast_starts_triggered", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_cast_interrupts", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_cast_finishs", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + GDVIRTUAL_BIND("_cast_starts", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_cast_starts_triggered", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_cast_interrupts", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_cast_finishs", "info", "SpellCastInfo"); //Aura Commands ClassDB::bind_method(D_METHOD("aura_sapply", "info"), &Spell::aura_sapply); @@ -2362,13 +2362,13 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("aura_removes_dispell", "aura"), &Spell::aura_removes_dispell); ClassDB::bind_method(D_METHOD("aura_supdate", "aura", "delta"), &Spell::aura_supdate); - BIND_VMETHOD(MethodInfo("_aura_sapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sdeapply", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_sadd", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_sremove", PropertyInfo(Variant::OBJECT, "aura", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_removes_expired", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_removes_dispell", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_aura_supdate", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "delta"))); + GDVIRTUAL_BIND("_aura_sapply", "info", "AuraApplyInfo"); + GDVIRTUAL_BIND("_aura_sdeapply", "info", "AuraData"); + GDVIRTUAL_BIND("_aura_sadd", "aura", "AuraData"); + GDVIRTUAL_BIND("_aura_sremove", "aura", "AuraData"); + GDVIRTUAL_BIND("_aura_removes_expired", "info", "AuraData"); + GDVIRTUAL_BIND("_aura_removes_dispell", "info", "AuraData"); + GDVIRTUAL_BIND("_aura_supdate", "info", "AuraData", "delta"); ClassDB::bind_method(D_METHOD("_aura_sapply", "info"), &Spell::_aura_sapply); ClassDB::bind_method(D_METHOD("_aura_sdeapply", "aura"), &Spell::_aura_sdeapply); @@ -2384,23 +2384,23 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("son_spell_hit", "info"), &Spell::son_spell_hit); ClassDB::bind_method(D_METHOD("son_physics_process", "info", "delta"), &Spell::son_physics_process); - BIND_VMETHOD(MethodInfo("_son_cast_player_moved", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_son_cast_damage_received", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_son_spell_hit", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_son_physics_process", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"), PropertyInfo(Variant::REAL, "delta"))); + GDVIRTUAL_BIND("_son_cast_player_moved", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_son_cast_damage_received", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_son_spell_hit", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_son_physics_process", "info", "SpellCastInfo", "delta"); //Clientside Event Handlers - BIND_VMETHOD(MethodInfo("_notification_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + GDVIRTUAL_BIND("_notification_scast", "what", "info", "SpellCastInfo"); ClassDB::bind_method(D_METHOD("notification_scast", "what", "info"), &Spell::notification_scast); - BIND_VMETHOD(MethodInfo("_notification_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + GDVIRTUAL_BIND("_notification_ccast", "what", "info", "SpellCastInfo"); ClassDB::bind_method(D_METHOD("notification_ccast", "what", "info"), &Spell::notification_ccast); //Aura EventHandlers - BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_aura_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_notification_saura", "what", "data", "AuraData"); + GDVIRTUAL_BIND("_notification_sheal", "what", "data", "AuraData", "data", "SpellHealInfo"); + GDVIRTUAL_BIND("_notification_aura_scast", "what", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_notification_sdamage", "what", "data", "AuraData", "data", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &Spell::notification_saura); ClassDB::bind_method(D_METHOD("notification_sheal", "what", "aura", "info"), &Spell::notification_sheal); @@ -2430,33 +2430,33 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_sentity_resource_added", "data", "value"), &Spell::notification_sentity_resource_added); ClassDB::bind_method(D_METHOD("notification_sentity_resource_removed", "data", "value"), &Spell::notification_sentity_resource_removed); - BIND_VMETHOD(MethodInfo("_son_remove", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_son_remove_expired", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_son_remove_dispell", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_son_remove", "data", "AuraData"); + GDVIRTUAL_BIND("_son_remove_expired", "data", "AuraData"); + GDVIRTUAL_BIND("_son_remove_dispell", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_notification_sdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_notification_sdeath", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_notification_scooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_notification_scooldown_added", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_scooldown_removed", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_scategory_cooldown_added", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_scategory_cooldown_removed", "data", "AuraData", "id", "value"); - BIND_VMETHOD(MethodInfo("_notification_sgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_sgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_notification_sgcd_started", "data", "AuraData", "gcd"); + GDVIRTUAL_BIND("_notification_sgcd_finished", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_son_physics_process_aura", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_son_physics_process_aura", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_notification_sxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_slevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_sxp_gained", "data", "AuraData", "value"); + GDVIRTUAL_BIND("_notification_slevel_up", "data", "AuraData", "value"); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_sentity_resource_added", "data", "AuraData", "value"); + GDVIRTUAL_BIND("_notification_sentity_resource_removed", "data", "AuraData", "value"); //Aura Clientside Event Handlers - BIND_VMETHOD(MethodInfo("_notification_caura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_cheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_aura_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_cdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_notification_caura", "what", "data", "AuraData"); + GDVIRTUAL_BIND("_notification_cheal", "what", "data", "AuraData", "data", "SpellHealInfo"); + GDVIRTUAL_BIND("_notification_aura_ccast", "what", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_notification_cdamage", "what", "data", "AuraData", "data", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("notification_caura", "what", "data"), &Spell::notification_caura); ClassDB::bind_method(D_METHOD("notification_cheal", "what", "aura", "info"), &Spell::notification_cheal); @@ -2479,45 +2479,45 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_centity_resource_added", "data", "value"), &Spell::notification_centity_resource_added); ClassDB::bind_method(D_METHOD("notification_centity_resource_removed", "data", "value"), &Spell::notification_centity_resource_removed); - BIND_VMETHOD(MethodInfo("_con_cast_failed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_state_changed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_cast_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_con_spell_cast_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + GDVIRTUAL_BIND("_con_cast_failed", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_con_cast_started", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_con_cast_state_changed", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_con_cast_finished", "data", "AuraData", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_con_spell_cast_success", "data", "AuraData", "info", "SpellCastInfo"); - BIND_VMETHOD(MethodInfo("_notification_cdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_notification_cdeath", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_notification_ccooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_ccategory_cooldown_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_notification_ccooldown_added", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_ccooldown_removed", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_ccategory_cooldown_added", "data", "AuraData", "id", "value"); + GDVIRTUAL_BIND("_notification_ccategory_cooldown_removed", "data", "AuraData", "id", "value"); - BIND_VMETHOD(MethodInfo("_con_aura_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_con_aura_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_con_aura_refresh", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_con_aura_added", "data", "AuraData"); + GDVIRTUAL_BIND("_con_aura_removed", "data", "AuraData"); + GDVIRTUAL_BIND("_con_aura_refresh", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_con_damage_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_con_dealt_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_con_heal_dealt", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_con_dealt_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + GDVIRTUAL_BIND("_con_damage_dealt", "data", "AuraData", "info", "SpellDamageInfo"); + GDVIRTUAL_BIND("_con_dealt_damage", "data", "AuraData", "info", "SpellDamageInfo"); + GDVIRTUAL_BIND("_con_heal_dealt", "data", "AuraData", "info", "SpellHealInfo"); + GDVIRTUAL_BIND("_con_dealt_heal", "data", "AuraData", "info", "SpellHealInfo"); - BIND_VMETHOD(MethodInfo("_notification_cgcd_started", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_cgcd_finished", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); + GDVIRTUAL_BIND("_notification_cgcd_started", "data", "AuraData", "gcd"); + GDVIRTUAL_BIND("_notification_cgcd_finished", "data", "AuraData"); - BIND_VMETHOD(MethodInfo("_notification_cxp_gained", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_clevel_up", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_cxp_gained", "data", "AuraData", "value"); + GDVIRTUAL_BIND("_notification_clevel_up", "data", "AuraData", "value"); - BIND_VMETHOD(MethodInfo("_notification_centity_resource_added", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_centity_resource_removed", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_centity_resource_added", "data", "AuraData", "value"); + GDVIRTUAL_BIND("_notification_centity_resource_removed", "data", "AuraData", "value"); //Equipment - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_equip_should_deny", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_should_deny", "data", "AuraData", "equip_slot", "item", "ItemInstance"); - BIND_VMETHOD(MethodInfo("_equip_son_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_son_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_success", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_fail", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + GDVIRTUAL_BIND("_equip_son_success", "data", "AuraData", "equip_slot", "item", "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_son_fail", "data", "AuraData", "equip_slot", "item", "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_success", "data", "AuraData", "equip_slot", "item", "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_fail", "data", "AuraData", "equip_slot", "item", "ItemInstance", "old_item", "ItemInstance", "bag_slot"); ClassDB::bind_method(D_METHOD("equip_should_deny", "data", "equip_slot", "item"), &Spell::equip_should_deny); @@ -2530,20 +2530,20 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("calculate_initial_damage", "data"), &Spell::calculate_initial_damage); ClassDB::bind_method(D_METHOD("handle_spell_damage", "data"), &Spell::handle_spell_damage); - BIND_VMETHOD(MethodInfo("_calculate_initial_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_handle_spell_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_calculate_initial_damage", "data", "SpellDamageInfo"); + GDVIRTUAL_BIND("_handle_spell_damage", "data", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("calculate_initial_heal", "data"), &Spell::calculate_initial_heal); ClassDB::bind_method(D_METHOD("handle_spell_heal", "data"), &Spell::handle_spell_heal); - BIND_VMETHOD(MethodInfo("_calculate_initial_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_handle_spell_heal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + GDVIRTUAL_BIND("_calculate_initial_heal", "data", "SpellHealInfo"); + GDVIRTUAL_BIND("_handle_spell_heal", "data", "SpellHealInfo"); ClassDB::bind_method(D_METHOD("handle_projectile", "info"), &Spell::handle_projectile); ClassDB::bind_method(D_METHOD("handle_effect", "info"), &Spell::handle_effect); - BIND_VMETHOD(MethodInfo("_handle_projectile", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_handle_effect", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); + GDVIRTUAL_BIND("_handle_projectile", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_handle_effect", "info", "SpellCastInfo"); ClassDB::bind_method(D_METHOD("handle_gcd", "info"), &Spell::handle_gcd); ClassDB::bind_method(D_METHOD("handle_cooldown", "info"), &Spell::handle_cooldown); @@ -2567,7 +2567,7 @@ void Spell::_bind_methods() { //Aura Calculations / Queries ClassDB::bind_method(D_METHOD("setup_aura_data", "data", "info"), &Spell::setup_aura_data); - BIND_VMETHOD(MethodInfo("_setup_aura_data", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); + GDVIRTUAL_BIND("_setup_aura_data", "data", "AuraData", "info", "AuraApplyInfo"); ClassDB::bind_method(D_METHOD("_setup_aura_data", "data", "info"), &Spell::_setup_aura_data); @@ -2577,10 +2577,10 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("aura_calculate_initial_damage", "aura_data", "info"), &Spell::aura_calculate_initial_damage); ClassDB::bind_method(D_METHOD("handle_aura_damage", "aura_data", "data"), &Spell::handle_aura_damage); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_receive", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_damage_deal", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_calculate_initial_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_handle_aura_damage", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_aura_sapply_passives_damage_receive", "data", "SpellDamageInfo"); + GDVIRTUAL_BIND("_aura_sapply_passives_damage_deal", "data", "SpellDamageInfo"); + GDVIRTUAL_BIND("_aura_calculate_initial_damage", "data", "AuraData", "info", "AuraApplyInfo"); + GDVIRTUAL_BIND("_handle_aura_damage", "data", "AuraData", "info", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_receive", "info"), &Spell::_aura_sapply_passives_damage_receive); ClassDB::bind_method(D_METHOD("_aura_sapply_passives_damage_deal", "info"), &Spell::_aura_sapply_passives_damage_deal); @@ -2593,10 +2593,10 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("aura_calculate_initial_heal", "aura_data", "info"), &Spell::aura_calculate_initial_heal); ClassDB::bind_method(D_METHOD("handle_aura_heal", "aura_data", "data"), &Spell::handle_aura_heal); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_receive", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_sapply_passives_heal_deal", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); - BIND_VMETHOD(MethodInfo("_aura_calculate_initial_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "AuraApplyInfo"))); - BIND_VMETHOD(MethodInfo("_handle_aura_heal", PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"), PropertyInfo(Variant::OBJECT, "spell_heal_info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); + GDVIRTUAL_BIND("_aura_sapply_passives_heal_receive", "info", "SpellDamageInfo"); + GDVIRTUAL_BIND("_aura_sapply_passives_heal_deal", "info", "SpellDamageInfo"); + GDVIRTUAL_BIND("_aura_calculate_initial_heal", "aura_data", "AuraData", "info", "AuraApplyInfo"); + GDVIRTUAL_BIND("_handle_aura_heal", "aura_data", "AuraData", "spell_heal_info", "SpellHealInfo"); ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_receive", "info"), &Spell::_aura_sapply_passives_heal_receive); ClassDB::bind_method(D_METHOD("_aura_sapply_passives_heal_deal", "info"), &Spell::_aura_sapply_passives_heal_deal); @@ -2696,7 +2696,7 @@ void Spell::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells_cast_on_learn", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "spells_cast_on_learn_set", "spells_cast_on_learn_get"); ADD_GROUP("Texts", "text"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level"))); + GDVIRTUAL_BIND("_get_description", "class_level", "character_level"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_name"), "set_name", "get_name"); @@ -2938,7 +2938,7 @@ void Spell::_bind_methods() { ClassDB::bind_method(D_METHOD("aura_set_visual_spell_effects", "value"), &Spell::aura_set_visual_spell_effects); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "aura_visual_spell_effects", PROPERTY_HINT_RESOURCE_TYPE, "SpellEffectVisual"), "aura_set_visual_spell_effects", "aura_get_visual_spell_effects"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "desc"), "_aura_get_description", PropertyInfo(Variant::INT, "class_level"), PropertyInfo(Variant::INT, "character_level"))); + GDVIRTUAL_BIND("_aura_get_description", "class_level", "character_level"); ADD_GROUP("Aura Texts", "aura_text"); ClassDB::bind_method(D_METHOD("aura_get_text_translation_key"), &Spell::aura_get_text_translation_key); diff --git a/data/spells/spell.h b/data/spells/spell.h index 00d4538..d6266d9 100644 --- a/data/spells/spell.h +++ b/data/spells/spell.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "scene/resources/texture.h" diff --git a/data/spells/spell_cooldown_manipulation_data.h b/data/spells/spell_cooldown_manipulation_data.h index 1c9e36a..c1328c3 100644 --- a/data/spells/spell_cooldown_manipulation_data.h +++ b/data/spells/spell_cooldown_manipulation_data.h @@ -25,14 +25,11 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif -class SpellCooldownManipulationData : public Reference { - GDCLASS(SpellCooldownManipulationData, Reference); + +class SpellCooldownManipulationData : public RefCounted { + GDCLASS(SpellCooldownManipulationData, RefCounted); public: void set_id() {} diff --git a/data/spells/spell_effect_visual.h b/data/spells/spell_effect_visual.h index fa53d00..d0fcd1c 100644 --- a/data/spells/spell_effect_visual.h +++ b/data/spells/spell_effect_visual.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class SpellEffectVisual : public Resource { GDCLASS(SpellEffectVisual, Resource); diff --git a/database/ess_resource_db.cpp b/database/ess_resource_db.cpp index ce44e86..572d375 100644 --- a/database/ess_resource_db.cpp +++ b/database/ess_resource_db.cpp @@ -363,6 +363,6 @@ void ESSResourceDB::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &ESSResourceDB::clear); ClassDB::bind_method(D_METHOD("add_entity_resource_db", "other"), &ESSResourceDB::add_entity_resource_db); - BIND_VMETHOD(MethodInfo("_initialize")); + GDVIRTUAL_BIND("_initialize"); ClassDB::bind_method(D_METHOD("initialize"), &ESSResourceDB::initialize); } diff --git a/database/ess_resource_db.h b/database/ess_resource_db.h index 2d5cadc..466170e 100644 --- a/database/ess_resource_db.h +++ b/database/ess_resource_db.h @@ -25,21 +25,13 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/templates/hash_map.h" #include "core/string/ustring.h" #include "core/core_bind.h" #include "core/variant/variant.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/hash_map.h" -#include "core/ustring.h" -#include "core/bind/core_bind.h" -#include "core/variant.h" -#endif + #include "../item_enums.h" diff --git a/database/ess_resource_db_folders.h b/database/ess_resource_db_folders.h index 660851f..59ef72e 100644 --- a/database/ess_resource_db_folders.h +++ b/database/ess_resource_db_folders.h @@ -25,7 +25,6 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/variant/variant.h" #include "core/templates/vector.h" #include "core/templates/hash_map.h" @@ -33,15 +32,7 @@ SOFTWARE. #include "core/config/engine.h" #include "core/variant/array.h" #include "core/core_bind.h" -#else -#include "core/variant.h" -#include "core/vector.h" -#include "core/hash_map.h" -#include "core/ustring.h" -#include "core/engine.h" -#include "core/array.h" -#include "core/bind/core_bind.h" -#endif + #include "ess_resource_db_map.h" diff --git a/database/ess_resource_db_map.h b/database/ess_resource_db_map.h index c5f6f5c..8248a14 100644 --- a/database/ess_resource_db_map.h +++ b/database/ess_resource_db_map.h @@ -27,7 +27,6 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/variant/variant.h" #include "core/templates/vector.h" #include "core/templates/hash_map.h" @@ -35,15 +34,7 @@ SOFTWARE. #include "core/config/engine.h" #include "core/variant/array.h" #include "core/core_bind.h" -#else -#include "core/variant.h" -#include "core/vector.h" -#include "core/hash_map.h" -#include "core/ustring.h" -#include "core/engine.h" -#include "core/array.h" -#include "core/bind/core_bind.h" -#endif + #include "scene/main/node.h" diff --git a/database/ess_resource_db_static.h b/database/ess_resource_db_static.h index 5cc967f..f281e87 100644 --- a/database/ess_resource_db_static.h +++ b/database/ess_resource_db_static.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/templates/hash_map.h" -#else -#include "core/hash_map.h" -#endif + #include "ess_resource_db.h" diff --git a/drag_and_drop/es_drag_and_drop.h b/drag_and_drop/es_drag_and_drop.h index 76620df..5148417 100644 --- a/drag_and_drop/es_drag_and_drop.h +++ b/drag_and_drop/es_drag_and_drop.h @@ -25,18 +25,14 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#endif + #include "scene/main/node.h" -class ESDragAndDrop : public Reference { - GDCLASS(ESDragAndDrop, Reference); +class ESDragAndDrop : public RefCounted { + GDCLASS(ESDragAndDrop, RefCounted); public: static const String BINDING_STRING_ES_DRAG_AND_DROP_TYPE; diff --git a/editor/ess_editor_plugin.cpp b/editor/ess_editor_plugin.cpp index aeade8c..0d9c490 100644 --- a/editor/ess_editor_plugin.cpp +++ b/editor/ess_editor_plugin.cpp @@ -30,11 +30,8 @@ void ESSEditorPlugin::fix_ids(Variant param) { ESSEditorPlugin::ESSEditorPlugin(EditorNode *p_node) { editor = p_node; -#if VERSION_MAJOR > 3 //editor->add_tool_menu_item("ESS: make ids unique", this, "fix_ids"); -#else - editor->add_tool_menu_item("ESS: make ids unique", this, "fix_ids"); -#endif + } ESSEditorPlugin::~ESSEditorPlugin() { diff --git a/entities/ai/entity_ai.cpp b/entities/ai/entity_ai.cpp index 86c3586..735d8ec 100644 --- a/entities/ai/entity_ai.cpp +++ b/entities/ai/entity_ai.cpp @@ -354,13 +354,13 @@ EntityAI::~EntityAI() { } void EntityAI::_bind_methods() { - BIND_VMETHOD(MethodInfo("_on_set_owner")); + GDVIRTUAL_BIND("_on_set_owner"); - BIND_VMETHOD(MethodInfo("_update", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_pet_update", PropertyInfo(Variant::REAL, "delta"))); + GDVIRTUAL_BIND("_update", "delta"); + GDVIRTUAL_BIND("_pet_update", "delta"); - BIND_VMETHOD(MethodInfo("_move", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_pet_move", PropertyInfo(Variant::REAL, "delta"))); + GDVIRTUAL_BIND("_move", "delta"); + GDVIRTUAL_BIND("_pet_move", "delta"); ClassDB::bind_method(D_METHOD("get_enabled"), &EntityAI::get_enabled); ClassDB::bind_method(D_METHOD("set_enabled", "value"), &EntityAI::set_enabled); @@ -399,10 +399,10 @@ void EntityAI::_bind_methods() { ClassDB::bind_method(D_METHOD("_on_set_owner"), &EntityAI::_on_set_owner); //EventHandlers - BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_notification_saura", "what", "data", "AuraData"); + GDVIRTUAL_BIND("_notification_sheal", "what", "info", "SpellHealInfo"); + GDVIRTUAL_BIND("_notification_scast", "what", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_notification_sdamage", "what", "info", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &EntityAI::notification_saura); ClassDB::bind_method(D_METHOD("notification_sheal", "what", "info"), &EntityAI::notification_sheal); @@ -426,31 +426,31 @@ void EntityAI::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_sentity_resource_added", "resource"), &EntityAI::notification_sentity_resource_added); ClassDB::bind_method(D_METHOD("notification_sentity_resource_removed", "resource"), &EntityAI::notification_sentity_resource_removed); - BIND_VMETHOD(MethodInfo("_notification_sdeath", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_notification_sdeath", "data", "Entity"); - BIND_VMETHOD(MethodInfo("_notification_scooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_notification_scooldown_added", "id", "value"); + GDVIRTUAL_BIND("_notification_scooldown_removed", "id", "value"); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_notification_scategory_cooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_notification_scategory_cooldown_added", "id", "value"); + GDVIRTUAL_BIND("_notification_scategory_cooldown_removed", "id", "value"); - BIND_VMETHOD(MethodInfo("_notification_sgcd_started", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_sgcd_finished", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_notification_sgcd_started", "entity", "Entity", "gcd"); + GDVIRTUAL_BIND("_notification_sgcd_finished", "entity", "Entity"); - BIND_VMETHOD(MethodInfo("_notification_sxp_gained", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_slevel_up", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_sxp_gained", "entity", "Entity", "value"); + GDVIRTUAL_BIND("_notification_slevel_up", "entity", "Entity", "value"); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_added", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_removed", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); + GDVIRTUAL_BIND("_notification_sentity_resource_added", "resource", "EntityResource"); + GDVIRTUAL_BIND("_notification_sentity_resource_removed", "resource", "EntityResource"); //Equipment - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_equip_should_deny", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_should_deny", "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity", "equip_slot", "item", "ItemInstance"); - BIND_VMETHOD(MethodInfo("_equip_son_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_son_fail", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_fail", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + GDVIRTUAL_BIND("_equip_son_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_son_fail", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_fail", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); ClassDB::bind_method(D_METHOD("equip_should_deny", "entity", "equip_slot", "item"), &EntityAI::equip_should_deny_bind); diff --git a/entities/ai/entity_ai.h b/entities/ai/entity_ai.h index 9d500c3..8433207 100644 --- a/entities/ai/entity_ai.h +++ b/entities/ai/entity_ai.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "scene/main/node.h" diff --git a/entities/auras/aura_data.cpp b/entities/auras/aura_data.cpp index 40ef434..1cf3962 100644 --- a/entities/auras/aura_data.cpp +++ b/entities/auras/aura_data.cpp @@ -308,11 +308,8 @@ Dictionary AuraData::_to_dict() { return dict; } void AuraData::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + ERR_FAIL_COND(!ESS::get_singleton()->get_resource_db().is_valid()); _aura_id = dict.get("aura_id", 0); @@ -447,8 +444,8 @@ void AuraData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "slow"), "set_slow", "get_slow"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &AuraData::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &AuraData::to_dict); @@ -456,8 +453,8 @@ void AuraData::_bind_methods() { ClassDB::bind_method(D_METHOD("_to_dict"), &AuraData::_to_dict); //Networking - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::ARRAY, "arr"), "_to_send_array")); - BIND_VMETHOD(MethodInfo("_from_send_array", PropertyInfo(Variant::ARRAY, "arr"))); + GDVIRTUAL_BIND("_to_send_array"); + GDVIRTUAL_BIND("_from_send_array", "arr"); ClassDB::bind_method(D_METHOD("to_send_array"), &AuraData::to_send_array); ClassDB::bind_method(D_METHOD("from_send_array", "arr"), &AuraData::from_send_array); diff --git a/entities/auras/aura_data.h b/entities/auras/aura_data.h index 16d9543..20fd5f8 100644 --- a/entities/auras/aura_data.h +++ b/entities/auras/aura_data.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" -#else -#include "core/resource.h" -#include "core/array.h" -#include "core/dictionary.h" -#endif + #include "../../spell_enums.h" diff --git a/entities/data/character_spec.h b/entities/data/character_spec.h index 43a359e..089217f 100644 --- a/entities/data/character_spec.h +++ b/entities/data/character_spec.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + class Spell; diff --git a/entities/data/entity_class_data.cpp b/entities/data/entity_class_data.cpp index d436e28..682d8e6 100644 --- a/entities/data/entity_class_data.cpp +++ b/entities/data/entity_class_data.cpp @@ -332,7 +332,7 @@ Ref EntityClassData::_get_ai_instance() { } Ref ai; - ai.instance(); + ai.instantiate(); return ai; } @@ -378,7 +378,7 @@ EntityClassData::~EntityClassData() { } void EntityClassData::_bind_methods() { - BIND_VMETHOD(MethodInfo("_setup_resources", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_setup_resources", "entity", "Entity"); ClassDB::bind_method(D_METHOD("get_id"), &EntityClassData::get_id); ClassDB::bind_method(D_METHOD("set_id", "value"), &EntityClassData::set_id); @@ -498,7 +498,7 @@ void EntityClassData::_bind_methods() { ClassDB::bind_method(D_METHOD("set_ais", "auras"), &EntityClassData::set_ais); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "ais", PROPERTY_HINT_NONE, "17/17:EntityAI", PROPERTY_USAGE_DEFAULT, "EntityAI"), "set_ais", "get_ais"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "EntityAI"), "_get_ai_instance")); + GDVIRTUAL_BIND("_get_ai_instance"); ClassDB::bind_method(D_METHOD("get_ai_instance"), &EntityClassData::get_ai_instance); ClassDB::bind_method(D_METHOD("_get_ai_instance"), &EntityClassData::_get_ai_instance); diff --git a/entities/data/entity_class_data.h b/entities/data/entity_class_data.h index 9061b1f..3ce35ea 100644 --- a/entities/data/entity_class_data.h +++ b/entities/data/entity_class_data.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + #include "core/math/math_funcs.h" #include "scene/resources/texture.h" diff --git a/entities/data/entity_data.cpp b/entities/data/entity_data.cpp index 9e5c288..0ad3342 100644 --- a/entities/data/entity_data.cpp +++ b/entities/data/entity_data.cpp @@ -140,7 +140,7 @@ Ref EntityData::_get_ai_instance() { } Ref ai; - ai.instance(); + ai.instantiate(); return ai; } @@ -265,8 +265,8 @@ void EntityData::_validate_property(PropertyInfo &property) const { void EntityData::_bind_methods() { //Interactions - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "can"), "_cans_interact", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_sinteract", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_cans_interact", "entity", "Entity"); + GDVIRTUAL_BIND("_sinteract", "entity", "Entity"); ClassDB::bind_method(D_METHOD("cans_interact", "entity"), &EntityData::cans_interact_bind); ClassDB::bind_method(D_METHOD("sinteract", "entity"), &EntityData::sinteract_bind); @@ -314,7 +314,7 @@ void EntityData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "species_instance", PROPERTY_HINT_RESOURCE_TYPE, "SpeciesInstance"), "set_species_instance", "get_species_instance"); //AI - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "ret", PROPERTY_HINT_RESOURCE_TYPE, "EntityAI"), "_get_ai_instance")); + GDVIRTUAL_BIND("_get_ai_instance"); ClassDB::bind_method(D_METHOD("get_ai"), &EntityData::get_ai); ClassDB::bind_method(D_METHOD("set_ai", "value"), &EntityData::set_ai); @@ -329,7 +329,7 @@ void EntityData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "loot_db", PROPERTY_HINT_RESOURCE_TYPE, "LootDataBase"), "set_loot_db", "get_loot_db"); ClassDB::bind_method(D_METHOD("generate_name"), &EntityData::generate_name); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "name"), "_generate_name")); + GDVIRTUAL_BIND("_generate_name"); ADD_GROUP("Immunities", "immunity"); ClassDB::bind_method(D_METHOD("get_immunity_flags"), &EntityData::get_immunity_flags); diff --git a/entities/data/entity_data.h b/entities/data/entity_data.h index 11fa316..d4e6647 100644 --- a/entities/data/entity_data.h +++ b/entities/data/entity_data.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + #include "scene/resources/texture.h" diff --git a/entities/data/entity_data_container.cpp b/entities/data/entity_data_container.cpp index 5a7dbaa..5ebf6d2 100644 --- a/entities/data/entity_data_container.cpp +++ b/entities/data/entity_data_container.cpp @@ -39,11 +39,8 @@ Dictionary EntityDataContainer::_to_dict() { return dict; } void EntityDataContainer::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + } EntityDataContainer::EntityDataContainer() { @@ -53,8 +50,8 @@ EntityDataContainer::~EntityDataContainer() { void EntityDataContainer::_bind_methods() { //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("from_dict", "dict"); + GDVIRTUAL_BIND("to_dict", "dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &EntityDataContainer::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &EntityDataContainer::to_dict); diff --git a/entities/data/entity_data_container.h b/entities/data/entity_data_container.h index efb0b85..d367e5f 100644 --- a/entities/data/entity_data_container.h +++ b/entities/data/entity_data_container.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/variant/dictionary.h" -#else -#include "core/resource.h" -#include "core/dictionary.h" -#endif + class EntityDataContainer : public Resource { GDCLASS(EntityDataContainer, Resource); diff --git a/entities/data/item_container_data.h b/entities/data/item_container_data.h index 1597954..b88b14e 100644 --- a/entities/data/item_container_data.h +++ b/entities/data/item_container_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "item_container_data_entry.h" diff --git a/entities/data/item_container_data_entry.h b/entities/data/item_container_data_entry.h index 2dd8dd8..e65bf16 100644 --- a/entities/data/item_container_data_entry.h +++ b/entities/data/item_container_data_entry.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class ItemTemplate; diff --git a/entities/data/vendor_item_data.h b/entities/data/vendor_item_data.h index c0dd9de..924e74c 100644 --- a/entities/data/vendor_item_data.h +++ b/entities/data/vendor_item_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "vendor_item_data_entry.h" diff --git a/entities/data/vendor_item_data_entry.h b/entities/data/vendor_item_data_entry.h index 51b0f67..7952e79 100644 --- a/entities/data/vendor_item_data_entry.h +++ b/entities/data/vendor_item_data_entry.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class ItemTemplate; class Spell; diff --git a/entities/entity.cpp b/entities/entity.cpp index 1548ecd..0036b2e 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -43,11 +43,8 @@ SOFTWARE. #include "./skills/entity_skill.h" #include "scene/2d/node_2d.h" -#if VERSION_MAJOR > 3 #include "core/object/script_language.h" -#else -#include "core/script_language.h" -#endif + #include "core/version.h" @@ -209,7 +206,7 @@ void Entity::instance_body(const Ref &data, const int model_index) { data->get_entity_species_data()->get_model_data_count() > model_index && data->get_entity_species_data()->get_model_data(model_index).is_valid() && data->get_entity_species_data()->get_model_data(model_index)->get_body().is_valid()) { - Node *node = data->get_entity_species_data()->get_model_data(model_index)->get_body()->instance(); + Node *node = data->get_entity_species_data()->get_model_data(model_index)->get_body()->instantiate(); add_child(node); set_body(node); @@ -269,7 +266,7 @@ void Entity::setc_guid(int value) { } //Transforms -Transform Entity::get_transform_3d(bool only_stored) const { +Transform3D Entity::get_transform_3d(bool only_stored) const { if (!only_stored && _body_3d) { ERR_FAIL_COND_V(!INSTANCE_VALIDATE(_body_3d), _transform); @@ -278,7 +275,7 @@ Transform Entity::get_transform_3d(bool only_stored) const { return _transform; } -void Entity::set_transform_3d(const Transform &transform, bool only_stored) { +void Entity::set_transform_3d(const Transform3D &transform, bool only_stored) { if (!only_stored && _body_3d) { ERR_FAIL_COND(!INSTANCE_VALIDATE(_body_3d)); @@ -650,11 +647,8 @@ void Entity::setup(Ref info) { sets_entity_name(info->get_entity_name()); } -#if VERSION_MAJOR > 3 if (!info->get_serialized_data().is_empty()) { -#else - if (!info->get_serialized_data().empty()) { -#endif + from_dict(info->get_serialized_data()); } else { sets_entity_data(info->get_entity_data()); @@ -865,7 +859,7 @@ void Entity::setup_actionbars() { if (!gets_bag().is_valid()) { Ref bag; - bag.instance(); + bag.instantiate(); bag->set_size(gets_entity_data()->get_bag_size()); @@ -1005,7 +999,7 @@ void Entity::pet_removes_index(int index) { Entity *entity = _s_pets.get(index); - _s_pets.remove(index); + _s_pets.remove_at(index); sees_removes(entity); @@ -1079,7 +1073,7 @@ void Entity::pet_removec_index(int index) { //Entity *entity = _c_pets.get(index); - _c_pets.remove(index); + _c_pets.remove_at(index); //#if VERSION_MAJOR < 4 //ERR_FAIL_COND(!ObjectDB::instance_validate(entity)); @@ -1359,11 +1353,8 @@ Dictionary Entity::_to_dict() { return dict; } void Entity::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + //// Transforms //// @@ -1438,7 +1429,7 @@ void Entity::_from_dict(const Dictionary &dict) { Ref ii = _s_equipment[i]; if (!ii.is_valid()) { - ii.instance(); + ii.instantiate(); } ii->from_dict(equipment[String::num(i)]); @@ -1510,7 +1501,7 @@ void Entity::_from_dict(const Dictionary &dict) { for (int i = 0; i < auras.size(); ++i) { Ref r; - r.instance(); + r.instantiate(); r->from_dict(auras.get(String::num(i), Dictionary())); r->set_owner(this); @@ -1646,7 +1637,7 @@ void Entity::_from_dict(const Dictionary &dict) { for (int i = 0; i < skills.size(); ++i) { Ref r; - r.instance(); + r.instantiate(); r->from_dict(skills.get(String::num(i), Dictionary())); @@ -1658,14 +1649,11 @@ void Entity::_from_dict(const Dictionary &dict) { Dictionary bagd = dict.get("bag", Dictionary()); -#if VERSION_MAJOR > 3 if (!bagd.is_empty()) { -#else - if (!bagd.empty()) { -#endif + if (!_s_bag.is_valid()) { Ref bag; - bag.instance(); + bag.instantiate(); bag->from_dict(bagd); @@ -1681,7 +1669,7 @@ void Entity::_from_dict(const Dictionary &dict) { if (dict.has("actionbar_profile")) { if (!_action_bar_profile.is_valid()) - _action_bar_profile.instance(); + _action_bar_profile.instantiate(); _action_bar_profile->from_dict(dict.get("actionbar_profile", Dictionary())); } @@ -2522,7 +2510,7 @@ void Entity::resource_removes(int index) { ERR_FAIL_INDEX(index, _s_resources.size()); Ref res = _s_resources.get(index); - _s_resources.remove(index); + _s_resources.remove_at(index); notification_sentity_resource_removed(res); @@ -2544,7 +2532,7 @@ void Entity::resource_addc_rpc(int index, String data) { res = Ref(Object::cast_to(ClassDB::instance(clsname))); ERR_FAIL_COND(!res.is_valid()); - //res.instance(); + //res.instantiate(); String script_path = dict.get("script", ""); @@ -2617,7 +2605,7 @@ void Entity::resource_removec(int index) { ERR_FAIL_INDEX(index, _c_resources.size()); Ref res = _c_resources.get(index); - _c_resources.remove(index); + _c_resources.remove_at(index); notification_centity_resource_removed(res); } @@ -2826,7 +2814,7 @@ void Entity::sdeal_heal_to(Ref info) { //Damage, Heal RPCs void Entity::cdamage_dealt_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -2834,7 +2822,7 @@ void Entity::cdamage_dealt_rpc(String data) { } void Entity::cdealt_damage_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -2842,7 +2830,7 @@ void Entity::cdealt_damage_rpc(String data) { } void Entity::cheal_dealt_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -2850,7 +2838,7 @@ void Entity::cheal_dealt_rpc(String data) { } void Entity::cdealt_heal_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -3069,7 +3057,7 @@ void Entity::_item_uses(int item_id) { return; Ref info; - info.instance(); + info.instantiate(); info->caster_set(this); info->target_set(gets_target()); @@ -3088,7 +3076,7 @@ void Entity::_item_uses(int item_id) { return; Ref info; - info.instance(); + info.instantiate(); info->caster_set(this); info->target_set(gets_target()); @@ -3406,7 +3394,7 @@ void Entity::aura_refresheds(Ref aura) { void Entity::aura_addc_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3416,7 +3404,7 @@ void Entity::aura_addc_rpc(String data) { void Entity::aura_removec_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3426,7 +3414,7 @@ void Entity::aura_removec_rpc(String data) { void Entity::aura_removec_exact_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3436,7 +3424,7 @@ void Entity::aura_removec_exact_rpc(String data) { void Entity::aura_removec_expired_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3446,7 +3434,7 @@ void Entity::aura_removec_expired_rpc(String data) { void Entity::aura_removec_dispelled_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3456,7 +3444,7 @@ void Entity::aura_removec_dispelled_rpc(String data) { void Entity::aura_refreshedc_rpc(String data) { Ref aura; - aura.instance(); + aura.instantiate(); aura->from_dict(data_as_dict(data)); aura->set_owner(this); aura->resolve_references(this); @@ -3799,7 +3787,7 @@ void Entity::cast_interrupts() { void Entity::cast_startc_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -3844,7 +3832,7 @@ void Entity::cast_spell_successs(Ref info) { void Entity::cast_spell_successc_rpc(String data) { Ref info; - info.instance(); + info.instantiate(); info->from_dict(data_as_dict(data)); info->resolve_references(this); @@ -4489,7 +4477,7 @@ void Entity::skill_addc_id(int skill_id, int value, int max_value) { ERR_FAIL_COND(skill_hasc_id(skill_id)); Ref skill; - skill.instance(); + skill.instantiate(); skill->set_skill_id(skill_id); skill->set_current(value); @@ -4796,7 +4784,7 @@ void Entity::_class_talent_sreceive_learn_request(int spec_index, int class_tale } Ref info; - info.instance(); + info.instantiate(); info->caster_set(this); info->target_set(this); @@ -5043,7 +5031,7 @@ void Entity::_character_talent_sreceive_learn_request(int spec_index, int charac } Ref info; - info.instance(); + info.instantiate(); info->caster_set(this); info->target_set(this); @@ -5296,14 +5284,14 @@ void Entity::setc_target_bag(const Ref bag) { void Entity::setc_bag_rpc(String data) { Ref bag; - bag.instance(); + bag.instantiate(); bag->from_dict(data_as_dict(data)); setc_bag(bag); } void Entity::setc_target_bag_rpc(String data) { Ref bag; - bag.instance(); + bag.instantiate(); bag->from_dict(data_as_dict(data)); setc_target_bag(bag); @@ -5334,7 +5322,7 @@ void Entity::notification_item_sadded(Ref bag, Ref item, int } void Entity::item_addc_rpc(int slot_id, String item_data) { Ref ii; - ii.instance(); + ii.instantiate(); ii->from_dict(data_as_dict(item_data)); item_addc(slot_id, ii); @@ -5405,7 +5393,7 @@ void Entity::notification_target_item_sadded(Ref bag, Ref ite } void Entity::target_item_addc_rpc(int slot_id, String item_data) { Ref ii; - ii.instance(); + ii.instantiate(); ii->from_dict(data_as_dict(item_data)); target_item_addc(slot_id, ii); @@ -5490,7 +5478,7 @@ void Entity::data_adds(Ref data) { void Entity::data_removes(int index) { ERR_FAIL_INDEX(index, _s_data.size()); - _s_data.remove(index); + _s_data.remove_at(index); } Ref Entity::data_gets(int index) { ERR_FAIL_INDEX_V(index, _s_data.size(), Ref()); @@ -5507,7 +5495,7 @@ void Entity::data_addc(Ref data) { void Entity::data_removec(int index) { ERR_FAIL_INDEX(index, _c_data.size()); - _c_data.remove(index); + _c_data.remove_at(index); } Ref Entity::data_getc(int index) { ERR_FAIL_INDEX_V(index, _c_data.size(), Ref()); @@ -5538,7 +5526,7 @@ Ref Entity::get_action_bar_profile() { if (_action_bar_profile.is_valid()) return _action_bar_profile; - _action_bar_profile.instance(); + _action_bar_profile.instantiate(); Ref cp = ProfileManager::get_singleton()->getc_player_profile()->get_class_profile(gets_entity_data()->get_path()); @@ -5691,13 +5679,13 @@ void Entity::sees_removes_index(int index) { Entity *e = _s_sees.get(index); if (unlikely(!INSTANCE_VALIDATE(e))) { - _s_sees.remove(index); + _s_sees.remove_at(index); return; } e->seen_by_removes(this); - _s_sees.remove(index); + _s_sees.remove_at(index); } void Entity::sees_removes(Entity *entity) { if (unlikely(!INSTANCE_VALIDATE(entity))) { @@ -5745,7 +5733,7 @@ Entity *Entity::seen_by_gets(int index) { return _s_seen_by.get(index); } void Entity::seen_by_removes_index(int index) { - _s_seen_by.remove(index); + _s_seen_by.remove_at(index); } void Entity::seen_by_removes(Entity *entity) { _s_seen_by.erase(entity); @@ -5971,7 +5959,7 @@ Entity::Entity() { _s_free_spell_points = 0; _c_free_spell_points = 0; - //_action_bar_profile.instance(); + //_action_bar_profile.instantiate(); _actionbar_locked = false; _stats.resize(ESS::get_singleton()->stat_get_count()); @@ -6781,8 +6769,8 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("onc_open_winow_request", PropertyInfo(Variant::INT, "window_id"))); //setup - BIND_VMETHOD(MethodInfo("_setup")); - BIND_VMETHOD(MethodInfo("_initialize")); + GDVIRTUAL_BIND("_setup"); + GDVIRTUAL_BIND("_initialize"); ClassDB::bind_method(D_METHOD("_initialize"), &Entity::_initialize); ClassDB::bind_method(D_METHOD("setup", "info"), &Entity::setup); @@ -6829,19 +6817,19 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_cstat_changed", "stat"), &Entity::notification_cstat_changed); //EventHandlers - BIND_VMETHOD(MethodInfo("_notification_sdeath")); + GDVIRTUAL_BIND("_notification_sdeath"); - BIND_VMETHOD(MethodInfo("_notification_sgcd_started", PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_sgcd_finished")); + GDVIRTUAL_BIND("_notification_sgcd_started", "gcd"); + GDVIRTUAL_BIND("_notification_sgcd_finished"); - BIND_VMETHOD(MethodInfo("_notification_sxp_gained", PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_slevel_up", PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_sxp_gained", "value"); + GDVIRTUAL_BIND("_notification_slevel_up", "value"); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_added", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); - BIND_VMETHOD(MethodInfo("_notification_sentity_resource_removed", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); + GDVIRTUAL_BIND("_notification_sentity_resource_added", "resource", "EntityResource"); + GDVIRTUAL_BIND("_notification_sentity_resource_removed", "resource", "EntityResource"); - BIND_VMETHOD(MethodInfo("_son_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "old_target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_con_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "old_target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_son_target_changed", "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity", "old_target", "Entity"); + GDVIRTUAL_BIND("_con_target_changed", "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity", "old_target", "Entity"); //Serverside ADD_SIGNAL(MethodInfo("notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); @@ -6849,10 +6837,10 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("notification_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "spell_cast_info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); ADD_SIGNAL(MethodInfo("notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_saura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_sheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_scast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_sdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_notification_saura", "what", "data", "AuraData"); + GDVIRTUAL_BIND("_notification_sheal", "what", "info", "SpellHealInfo"); + GDVIRTUAL_BIND("_notification_scast", "what", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_notification_sdamage", "what", "info", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("notification_saura", "what", "data"), &Entity::notification_saura); ClassDB::bind_method(D_METHOD("notification_sheal", "what", "info"), &Entity::notification_sheal); @@ -6865,10 +6853,10 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("notification_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "spell_cast_info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); ADD_SIGNAL(MethodInfo("notification_caura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "aura_data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_caura", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "AuraData"))); - BIND_VMETHOD(MethodInfo("_notification_cheal", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellHealInfo"))); - BIND_VMETHOD(MethodInfo("_notification_ccast", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo"))); - BIND_VMETHOD(MethodInfo("_notification_cdamage", PropertyInfo(Variant::INT, "what"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellDamageInfo"))); + GDVIRTUAL_BIND("_notification_caura", "what", "data", "AuraData"); + GDVIRTUAL_BIND("_notification_cheal", "what", "info", "SpellHealInfo"); + GDVIRTUAL_BIND("_notification_ccast", "what", "info", "SpellCastInfo"); + GDVIRTUAL_BIND("_notification_cdamage", "what", "info", "SpellDamageInfo"); ClassDB::bind_method(D_METHOD("notification_caura", "what", "data"), &Entity::notification_caura); ClassDB::bind_method(D_METHOD("notification_cheal", "what", "info"), &Entity::notification_cheal); @@ -6893,8 +6881,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("setc_free_class_talent_points", "value"), &Entity::setc_free_class_talent_points); ADD_PROPERTY(PropertyInfo(Variant::INT, "cfree_class_talent_points", PROPERTY_HINT_NONE, "", 0), "setc_free_class_talent_points", "getc_free_class_talent_points"); - BIND_VMETHOD(MethodInfo("_class_talent_sreceive_learn_request", PropertyInfo(Variant::INT, "spec_index"), PropertyInfo(Variant::INT, "class_talent_row"), PropertyInfo(Variant::INT, "class_talent_culomn"))); - BIND_VMETHOD(MethodInfo("_class_talent_sreceive_reset_request")); + GDVIRTUAL_BIND("_class_talent_sreceive_learn_request", "spec_index", "class_talent_row", "class_talent_culomn"); + GDVIRTUAL_BIND("_class_talent_sreceive_reset_request"); ADD_SIGNAL(MethodInfo("sclass_talent_learned", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "class_talent_id"))); ADD_SIGNAL(MethodInfo("cclass_talent_learned", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "class_talent_id"))); @@ -6902,11 +6890,11 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("sclass_talent_reset", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); ADD_SIGNAL(MethodInfo("cclass_talent_reset", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_son_class_talent_learned", PropertyInfo(Variant::INT, "class_talent_id"))); - BIND_VMETHOD(MethodInfo("_con_class_talent_learned", PropertyInfo(Variant::INT, "class_talent_id"))); + GDVIRTUAL_BIND("_son_class_talent_learned", "class_talent_id"); + GDVIRTUAL_BIND("_con_class_talent_learned", "class_talent_id"); - BIND_VMETHOD(MethodInfo("_son_class_talent_reset")); - BIND_VMETHOD(MethodInfo("_con_class_talent_reset")); + GDVIRTUAL_BIND("_son_class_talent_reset"); + GDVIRTUAL_BIND("_con_class_talent_reset"); ClassDB::bind_method(D_METHOD("class_talent_crequest_learn", "spec_index", "class_talent_row", "class_talent_culomn"), &Entity::class_talent_crequest_learn); ClassDB::bind_method(D_METHOD("class_talent_sreceive_learn_request", "spec_index", "class_talent_row", "class_talent_culomn"), &Entity::class_talent_sreceive_learn_request); @@ -6947,8 +6935,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("setc_free_character_talent_points", "value"), &Entity::setc_free_character_talent_points); ADD_PROPERTY(PropertyInfo(Variant::INT, "cfree_character_talent_points", PROPERTY_HINT_NONE, "", 0), "setc_free_character_talent_points", "getc_free_character_talent_points"); - BIND_VMETHOD(MethodInfo("_character_talent_sreceive_learn_request", PropertyInfo(Variant::INT, "spec_index"), PropertyInfo(Variant::INT, "character_talent_row"), PropertyInfo(Variant::INT, "character_talent_culomn"))); - BIND_VMETHOD(MethodInfo("_character_talent_sreceive_reset_request")); + GDVIRTUAL_BIND("_character_talent_sreceive_learn_request", "spec_index", "character_talent_row", "character_talent_culomn"); + GDVIRTUAL_BIND("_character_talent_sreceive_reset_request"); ADD_SIGNAL(MethodInfo("scharacter_talent_learned", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "character_talent_id"))); ADD_SIGNAL(MethodInfo("ccharacter_talent_learned", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "character_talent_id"))); @@ -6956,11 +6944,11 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("scharacter_talent_reset", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); ADD_SIGNAL(MethodInfo("ccharacter_talent_reset", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_son_character_talent_learned", PropertyInfo(Variant::INT, "character_talent_id"))); - BIND_VMETHOD(MethodInfo("_con_character_talent_learned", PropertyInfo(Variant::INT, "character_talent_id"))); + GDVIRTUAL_BIND("_son_character_talent_learned", "character_talent_id"); + GDVIRTUAL_BIND("_con_character_talent_learned", "character_talent_id"); - BIND_VMETHOD(MethodInfo("_son_character_talent_reset")); - BIND_VMETHOD(MethodInfo("_con_character_talent_reset")); + GDVIRTUAL_BIND("_son_character_talent_reset"); + GDVIRTUAL_BIND("_con_character_talent_reset"); ClassDB::bind_method(D_METHOD("character_talent_crequest_learn", "spec_index", "character_talent_row", "character_talent_culomn"), &Entity::character_talent_crequest_learn); ClassDB::bind_method(D_METHOD("character_talent_sreceive_learn_request", "spec_index", "character_talent_row", "character_talent_culomn"), &Entity::character_talent_sreceive_learn_request); @@ -6992,10 +6980,10 @@ void Entity::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "scharacter_talents", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_ENTITY_HIDDEN), "scharacter_talents_set", "scharacter_talents_get"); //Cooldowns - BIND_VMETHOD(MethodInfo("notification_scooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_scooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_scategory_cooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_scategory_cooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("notification_scooldown_added", "id", "value"); + GDVIRTUAL_BIND("notification_scooldown_removed", "id", "value"); + GDVIRTUAL_BIND("notification_scategory_cooldown_added", "id", "value"); + GDVIRTUAL_BIND("notification_scategory_cooldown_removed", "id", "value"); ClassDB::bind_method(D_METHOD("notification_scooldown_added", "cooldown"), &Entity::notification_scooldown_added); ClassDB::bind_method(D_METHOD("notification_scooldown_removed", "cooldown"), &Entity::notification_scooldown_removed); @@ -7003,30 +6991,30 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("notification_scategory_cooldown_removed", "category_cooldown"), &Entity::notification_scategory_cooldown_removed); //Clientside EventHandlers - BIND_VMETHOD(MethodInfo("_notification_cdeath")); + GDVIRTUAL_BIND("_notification_cdeath"); - BIND_VMETHOD(MethodInfo("notification_ccooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_ccooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_ccategory_cooldown_added", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("notification_ccategory_cooldown_removed", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("notification_ccooldown_added", "id", "value"); + GDVIRTUAL_BIND("notification_ccooldown_removed", "id", "value"); + GDVIRTUAL_BIND("notification_ccategory_cooldown_added", "id", "value"); + GDVIRTUAL_BIND("notification_ccategory_cooldown_removed", "id", "value"); ClassDB::bind_method(D_METHOD("notification_ccooldown_added", "cooldown"), &Entity::notification_ccooldown_added); ClassDB::bind_method(D_METHOD("notification_ccooldown_removed", "cooldown"), &Entity::notification_ccooldown_removed); ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_added", "category_cooldown"), &Entity::notification_ccategory_cooldown_added); ClassDB::bind_method(D_METHOD("notification_ccategory_cooldown_removed", "category_cooldown"), &Entity::notification_ccategory_cooldown_removed); - BIND_VMETHOD(MethodInfo("_notification_cgcd_started", PropertyInfo(Variant::REAL, "gcd"))); - BIND_VMETHOD(MethodInfo("_notification_cgcd_finished")); + GDVIRTUAL_BIND("_notification_cgcd_started", "gcd"); + GDVIRTUAL_BIND("_notification_cgcd_finished"); - BIND_VMETHOD(MethodInfo("_notification_cxp_gained", PropertyInfo(Variant::INT, "value"))); - BIND_VMETHOD(MethodInfo("_notification_clevel_up", PropertyInfo(Variant::INT, "value"))); + GDVIRTUAL_BIND("_notification_cxp_gained", "value"); + GDVIRTUAL_BIND("_notification_clevel_up", "value"); - BIND_VMETHOD(MethodInfo("_notification_centity_resource_added", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); - BIND_VMETHOD(MethodInfo("_notification_centity_resource_removed", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"))); + GDVIRTUAL_BIND("_notification_centity_resource_added", "resource", "EntityResource"); + GDVIRTUAL_BIND("_notification_centity_resource_removed", "resource", "EntityResource"); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "value"), "_canc_interact")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "value"), "_cans_interact")); - BIND_VMETHOD(MethodInfo("_sinteract")); + GDVIRTUAL_BIND("_canc_interact"); + GDVIRTUAL_BIND("_cans_interact"); + GDVIRTUAL_BIND("_sinteract"); ClassDB::bind_method(D_METHOD("cast_spell_successc", "info"), &Entity::cast_spell_successc); ClassDB::bind_method(D_METHOD("cast_spell_successc_rpc", "data"), &Entity::cast_spell_successc_rpc); @@ -7050,7 +7038,7 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("spell_casts", "spell_id"), &Entity::spell_casts); ClassDB::bind_method(D_METHOD("spell_crequest_cast", "spell_id"), &Entity::spell_crequest_cast); - BIND_VMETHOD(MethodInfo("_item_uses", PropertyInfo(Variant::INT, "item_id"))); + GDVIRTUAL_BIND("_item_uses", "item_id"); ClassDB::bind_method(D_METHOD("item_uses", "item_id"), &Entity::item_uses); ClassDB::bind_method(D_METHOD("item_crequest_use", "item_id"), &Entity::item_crequest_use); @@ -7080,8 +7068,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("ssend_open_window", "window_id"), &Entity::ssend_open_window); ClassDB::bind_method(D_METHOD("copen_window", "window_id"), &Entity::copen_window); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_iss_target_in_interact_range")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_isc_target_in_interact_range")); + GDVIRTUAL_BIND("_iss_target_in_interact_range"); + GDVIRTUAL_BIND("_isc_target_in_interact_range"); ClassDB::bind_method(D_METHOD("iss_target_in_interact_range"), &Entity::iss_target_in_interact_range); ClassDB::bind_method(D_METHOD("isc_target_in_interact_range"), &Entity::isc_target_in_interact_range); @@ -7143,14 +7131,14 @@ void Entity::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sauras", PROPERTY_HINT_NONE, "17/17:AuraData", PROPERTY_USAGE_ENTITY_HIDDEN, "AuraData"), "sauras_set", "sauras_get"); //Hooks - BIND_VMETHOD(MethodInfo("_moved")); + GDVIRTUAL_BIND("_moved"); ClassDB::bind_method(D_METHOD("moved"), &Entity::moved); ADD_SIGNAL(MethodInfo("notification_cmouse_entered")); ADD_SIGNAL(MethodInfo("notification_cmouse_exited")); - BIND_VMETHOD(MethodInfo("_notification_cmouse_enter")); - BIND_VMETHOD(MethodInfo("_notification_cmouse_exit")); + GDVIRTUAL_BIND("_notification_cmouse_enter"); + GDVIRTUAL_BIND("_notification_cmouse_exit"); ClassDB::bind_method(D_METHOD("notification_cmouse_enter"), &Entity::notification_cmouse_enter); ClassDB::bind_method(D_METHOD("notification_cmouse_exit"), &Entity::notification_cmouse_exit); @@ -7158,8 +7146,8 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("notification_ctargeted")); ADD_SIGNAL(MethodInfo("notification_cuntargeted")); - BIND_VMETHOD(MethodInfo("_notification_ctargeted")); - BIND_VMETHOD(MethodInfo("_notification_cuntargeted")); + GDVIRTUAL_BIND("_notification_ctargeted"); + GDVIRTUAL_BIND("_notification_cuntargeted"); ClassDB::bind_method(D_METHOD("notification_ctargeted"), &Entity::notification_ctargeted); ClassDB::bind_method(D_METHOD("notification_cuntargeted"), &Entity::notification_cuntargeted); @@ -7218,8 +7206,8 @@ void Entity::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "cseed", PROPERTY_HINT_NONE, "", 0), "setc_seed", "getc_seed"); //Interaction type - BIND_VMETHOD(MethodInfo("_gets_relation_to", PropertyInfo(Variant::OBJECT, "to", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_getc_relation_to", PropertyInfo(Variant::OBJECT, "to", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_gets_relation_to", "to", "Entity"); + GDVIRTUAL_BIND("_getc_relation_to", "to", "Entity"); ClassDB::bind_method(D_METHOD("gets_relation_to", "to"), &Entity::gets_relation_to_bind); ClassDB::bind_method(D_METHOD("_gets_relation_to", "to"), &Entity::_gets_relation_to); @@ -7307,12 +7295,12 @@ void Entity::_bind_methods() { ADD_SIGNAL(MethodInfo("equip_con_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); ADD_SIGNAL(MethodInfo("equip_con_fail", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "ret"), "_equip_should_deny", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_should_deny", "equip_slot", "item", "ItemInstance"); - BIND_VMETHOD(MethodInfo("_equip_son_success", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_son_fail", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_success", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); - BIND_VMETHOD(MethodInfo("_equip_con_fail", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::OBJECT, "old_item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "bag_slot"))); + GDVIRTUAL_BIND("_equip_son_success", PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_son_fail", PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_success", PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); + GDVIRTUAL_BIND("_equip_con_fail", PropertyInfo(Variant::INT, "equip_slot", "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance", "old_item", "ItemInstance", "bag_slot"); ADD_SIGNAL(MethodInfo("equipment_changed", PropertyInfo(Variant::INT, "slot"))); @@ -7323,7 +7311,7 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("equip_con_success", "equip_slot", "item", "old_item", "bag_slot"), &Entity::equip_con_success); ClassDB::bind_method(D_METHOD("equip_con_fail", "equip_slot", "item", "old_item", "bag_slot"), &Entity::equip_con_fail); - BIND_VMETHOD(MethodInfo("_equips", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::INT, "bag_slot"))); + GDVIRTUAL_BIND("_equips", "equip_slot", "bag_slot"); ClassDB::bind_method(D_METHOD("equip_crequest", "equip_slot", "bag_slot"), &Entity::equip_crequest); ClassDB::bind_method(D_METHOD("equips", "equip_slot", "bag_slot"), &Entity::equips); @@ -7335,13 +7323,13 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("equip_gets_slot", "index"), &Entity::equip_gets_slot); ClassDB::bind_method(D_METHOD("equip_getc_slot", "index"), &Entity::equip_getc_slot); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "can"), "_equip_can_equip_item", PropertyInfo(Variant::INT, "equip_slot"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_can_equip_item", "equip_slot", "item", "ItemInstance"); ClassDB::bind_method(D_METHOD("equip_can_equip_item", "equip_slot", "item"), &Entity::equip_can_equip_item); ClassDB::bind_method(D_METHOD("_equip_can_equip_item", "equip_slot", "item"), &Entity::_equip_can_equip_item); - BIND_VMETHOD(MethodInfo("_equip_applys_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); - BIND_VMETHOD(MethodInfo("_equip_deapplys_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_applys_item", "item", "ItemInstance"); + GDVIRTUAL_BIND("_equip_deapplys_item", "item", "ItemInstance"); ClassDB::bind_method(D_METHOD("equip_applys_item", "item"), &Entity::equip_applys_item); ClassDB::bind_method(D_METHOD("equip_deapplys_item", "item"), &Entity::equip_deapplys_item); @@ -7349,8 +7337,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("_equip_applys_item", "item"), &Entity::_equip_applys_item); ClassDB::bind_method(D_METHOD("_equip_deapplys_item", "item"), &Entity::_equip_deapplys_item); - BIND_VMETHOD(MethodInfo("_equip_applyc_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); - BIND_VMETHOD(MethodInfo("_equip_deapplyc_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_equip_applyc_item", "item", "ItemInstance"); + GDVIRTUAL_BIND("_equip_deapplyc_item", "item", "ItemInstance"); ClassDB::bind_method(D_METHOD("cequip_applys_item", "item"), &Entity::equip_applyc_item); ClassDB::bind_method(D_METHOD("equip_deapplyc_item", "item"), &Entity::equip_deapplyc_item); @@ -7564,7 +7552,7 @@ void Entity::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "sspells", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_ENTITY_HIDDEN, "Spell"), "sspells_set", "sspells_get"); //Crafting - BIND_VMETHOD(MethodInfo("_crafts", PropertyInfo(Variant::INT, "id"))); + GDVIRTUAL_BIND("_crafts", "id"); ADD_SIGNAL(MethodInfo("crafts_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); ADD_SIGNAL(MethodInfo("ccraft_success", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); @@ -7633,7 +7621,7 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("instance_body"), &Entity::instance_body); ClassDB::bind_method(D_METHOD("on_body_changed"), &Entity::on_body_changed); - BIND_VMETHOD(MethodInfo("_body_changed")); + GDVIRTUAL_BIND("_body_changed"); ADD_SIGNAL(MethodInfo("body_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); //Transforms @@ -7737,8 +7725,8 @@ void Entity::_bind_methods() { ClassDB::bind_method(D_METHOD("vendor_item_sell_crequest", "slot_id"), &Entity::vendor_item_sell_crequest); ClassDB::bind_method(D_METHOD("vendor_item_ssell", "slot_id"), &Entity::vendor_item_ssell); - BIND_VMETHOD(MethodInfo("_vendor_item_sbuy", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::INT, "count"))); - BIND_VMETHOD(MethodInfo("_vendor_item_ssell", PropertyInfo(Variant::INT, "slot_id"))); + GDVIRTUAL_BIND("_vendor_item_sbuy", "index", "count"); + GDVIRTUAL_BIND("_vendor_item_ssell", "slot_id"); ClassDB::bind_method(D_METHOD("_vendor_item_sbuy", "index", "count"), &Entity::_vendor_item_sbuy); ClassDB::bind_method(D_METHOD("_vendor_item_ssell", "slot_id"), &Entity::_vendor_item_ssell); @@ -7812,8 +7800,8 @@ void Entity::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sai", PROPERTY_HINT_RESOURCE_TYPE, "EntityAI", PROPERTY_USAGE_ENTITY_HIDDEN), "sets_ai", "gets_ai"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("is_deserialized"), &Entity::is_deserialized); diff --git a/entities/entity.h b/entities/entity.h index f996ace..f53925d 100644 --- a/entities/entity.h +++ b/entities/entity.h @@ -25,17 +25,12 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/object/object.h" #include "core/string/ustring.h" #include "core/templates/vector.h" -#else -#include "core/object.h" -#include "core/ustring.h" -#include "core/vector.h" -#endif -#include "core/io/networked_multiplayer_peer.h" + +#include "scene/main/multiplayer_peer.h" #include "scene/main/node.h" @@ -44,7 +39,7 @@ SOFTWARE. #include "../data/spells/spell.h" #include "core/io/json.h" -#include "core/math/transform.h" +#include "core/math/transform_3d.h" #include "core/math/transform_2d.h" #include "../data/spells/spell.h" @@ -258,8 +253,8 @@ public: void set_character_skeleton(Node *skeleton); //Transforms - Transform get_transform_3d(bool only_stored = false) const; - void set_transform_3d(const Transform &transform, bool only_stored = false); + Transform3D get_transform_3d(bool only_stored = false) const; + void set_transform_3d(const Transform3D &transform, bool only_stored = false); Transform2D get_transform_2d(bool only_stored = false) const; void set_transform_2d(const Transform2D &transform, bool only_stored = false); @@ -1154,7 +1149,7 @@ private: //// Transforms //// - Transform _transform; + Transform3D _transform; Transform2D _transform_2d; //// PlayerData //// diff --git a/entities/resources/entity_resource.cpp b/entities/resources/entity_resource.cpp index 164df12..a426036 100644 --- a/entities/resources/entity_resource.cpp +++ b/entities/resources/entity_resource.cpp @@ -286,11 +286,8 @@ Dictionary EntityResource::_to_dict() { return dict; } void EntityResource::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _dirty = dict.get("dirty", false); _should_process = dict.get("should_process", false); @@ -435,25 +432,25 @@ void EntityResource::_bind_methods() { ClassDB::bind_method(D_METHOD("mods_changed"), &EntityResource::mods_changed); - BIND_VMETHOD(MethodInfo("_notification_sstat_changed", PropertyInfo(Variant::INT, "statid"), PropertyInfo(Variant::REAL, "curent"))); - BIND_VMETHOD(MethodInfo("_notification_cstat_changed", PropertyInfo(Variant::INT, "statid"), PropertyInfo(Variant::REAL, "curent"))); + GDVIRTUAL_BIND("_notification_sstat_changed", "statid", "curent"); + GDVIRTUAL_BIND("_notification_cstat_changed", "statid", "curent"); - BIND_VMETHOD(MethodInfo("_ons_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "old_target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_onc_target_changed", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), PropertyInfo(Variant::OBJECT, "old_target", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_ons_target_changed", "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity", "old_target", "Entity"); + GDVIRTUAL_BIND("_onc_target_changed", "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity", "old_target", "Entity"); - BIND_VMETHOD(MethodInfo("_ons_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); - BIND_VMETHOD(MethodInfo("_onc_added", PropertyInfo(Variant::OBJECT, "entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"))); + GDVIRTUAL_BIND("_ons_added", "entity", "Entity"); + GDVIRTUAL_BIND("_onc_added", "entity", "Entity"); - BIND_VMETHOD(MethodInfo("_process_server", PropertyInfo(Variant::REAL, "delta"))); - BIND_VMETHOD(MethodInfo("_process_client", PropertyInfo(Variant::REAL, "delta"))); + GDVIRTUAL_BIND("_process_server", "delta"); + GDVIRTUAL_BIND("_process_client", "delta"); - BIND_VMETHOD(MethodInfo("_stacking_mod_added", PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_stacking_mod_removed", PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_stacking_mod_added", "value"); + GDVIRTUAL_BIND("_stacking_mod_removed", "value"); - BIND_VMETHOD(MethodInfo("_non_stacking_mod_added", PropertyInfo(Variant::REAL, "value"))); - BIND_VMETHOD(MethodInfo("_non_stacking_mod_removed", PropertyInfo(Variant::REAL, "value"))); + GDVIRTUAL_BIND("_non_stacking_mod_added", "value"); + GDVIRTUAL_BIND("_non_stacking_mod_removed", "value"); - BIND_VMETHOD(MethodInfo("_mods_changed")); + GDVIRTUAL_BIND("_mods_changed"); ClassDB::bind_method(D_METHOD("process_server", "delta"), &EntityResource::process_server); ClassDB::bind_method(D_METHOD("_process_server", "delta"), &EntityResource::_process_server); @@ -461,12 +458,12 @@ void EntityResource::_bind_methods() { ClassDB::bind_method(D_METHOD("process_client", "delta"), &EntityResource::process_client); ClassDB::bind_method(D_METHOD("_process_client", "delta"), &EntityResource::_process_client); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::STRING, "str"), "_gets_update_string")); - BIND_VMETHOD(MethodInfo("_receivec_update_string", PropertyInfo(Variant::STRING, "str"))); + GDVIRTUAL_BIND("_gets_update_string"); + GDVIRTUAL_BIND("_receivec_update_string", "str"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &EntityResource::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &EntityResource::to_dict); diff --git a/entities/resources/entity_resource.h b/entities/resources/entity_resource.h index e39f4f7..7fa9606 100644 --- a/entities/resources/entity_resource.h +++ b/entities/resources/entity_resource.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "../../defines.h" diff --git a/entities/resources/entity_resource_cost_data.h b/entities/resources/entity_resource_cost_data.h index 55fafc2..56882e3 100644 --- a/entities/resources/entity_resource_cost_data.h +++ b/entities/resources/entity_resource_cost_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "entity_resource.h" #include "entity_resource_cost_data.h" diff --git a/entities/resources/entity_resource_cost_data_health.h b/entities/resources/entity_resource_cost_data_health.h index 2c66758..3e4b809 100644 --- a/entities/resources/entity_resource_cost_data_health.h +++ b/entities/resources/entity_resource_cost_data_health.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "entity_resource.h" #include "entity_resource_cost_data.h" diff --git a/entities/resources/entity_resource_cost_data_resource.h b/entities/resources/entity_resource_cost_data_resource.h index 7f207ab..a802e8e 100644 --- a/entities/resources/entity_resource_cost_data_resource.h +++ b/entities/resources/entity_resource_cost_data_resource.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "entity_resource.h" #include "entity_resource_cost_data.h" diff --git a/entities/skills/entity_skill.cpp b/entities/skills/entity_skill.cpp index 144f464..d222f87 100644 --- a/entities/skills/entity_skill.cpp +++ b/entities/skills/entity_skill.cpp @@ -103,11 +103,8 @@ Dictionary EntitySkill::_to_dict() { return dict; } void EntitySkill::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _skill_id = dict.get("skill_id", 0); _skill_path = dict.get("skill_path", ""); @@ -153,8 +150,8 @@ void EntitySkill::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "get_disabled"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &EntitySkill::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &EntitySkill::to_dict); diff --git a/entities/skills/entity_skill.h b/entities/skills/entity_skill.h index ed4108e..4c0ba7e 100644 --- a/entities/skills/entity_skill.h +++ b/entities/skills/entity_skill.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "entity_skill_data.h" diff --git a/entities/skills/entity_skill_data.h b/entities/skills/entity_skill_data.h index d1a8e57..d8b6e4c 100644 --- a/entities/skills/entity_skill_data.h +++ b/entities/skills/entity_skill_data.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/ustring.h" -#endif + class EntitySkillData : public Resource { GDCLASS(EntitySkillData, Resource); diff --git a/entities/stats/complex_level_stat_data.h b/entities/stats/complex_level_stat_data.h index 7395fab..4a050fe 100644 --- a/entities/stats/complex_level_stat_data.h +++ b/entities/stats/complex_level_stat_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "../../entity_enums.h" #include "level_stat_data.h" diff --git a/entities/stats/level_stat_data.cpp b/entities/stats/level_stat_data.cpp index f962139..4d81ac1 100644 --- a/entities/stats/level_stat_data.cpp +++ b/entities/stats/level_stat_data.cpp @@ -31,7 +31,7 @@ int LevelStatData::get_stat_diff(int main_stat, int old_level, int new_level) { void LevelStatData::_bind_methods() { - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "diff"), "_get_stat_diff", PropertyInfo(Variant::INT, "main_stat"), PropertyInfo(Variant::INT, "old_level"), PropertyInfo(Variant::INT, "new_level"))); + GDVIRTUAL_BIND("_get_stat_diff", "main_stat", "old_level", "new_level"); ClassDB::bind_method(D_METHOD("get_stat_diff", "stat", "old_level", "new_level"), &LevelStatData::get_stat_diff); } diff --git a/entities/stats/level_stat_data.h b/entities/stats/level_stat_data.h index d94bd08..9aaeffe 100644 --- a/entities/stats/level_stat_data.h +++ b/entities/stats/level_stat_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class LevelStatData : public Resource { GDCLASS(LevelStatData, Resource); diff --git a/entities/stats/simple_level_stat_data.h b/entities/stats/simple_level_stat_data.h index a8eae5e..f0cd462 100644 --- a/entities/stats/simple_level_stat_data.h +++ b/entities/stats/simple_level_stat_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "level_stat_data.h" diff --git a/entities/stats/stat_data.h b/entities/stats/stat_data.h index 1ed5561..ebd4f7e 100644 --- a/entities/stats/stat_data.h +++ b/entities/stats/stat_data.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "scene/resources/curve.h" diff --git a/entity_enums.h b/entity_enums.h index 9b4b046..28b5358 100644 --- a/entity_enums.h +++ b/entity_enums.h @@ -24,15 +24,10 @@ SOFTWARE. #define ENTITY_ENUMS_H #include "core/version.h" - -#if VERSION_MAJOR > 3 #include "core/object/object.h" #include "core/string/ustring.h" #include "core/object/class_db.h" -#else -#include "core/object.h" -#include "core/ustring.h" -#endif + class EntityEnums : public Object { GDCLASS(EntityEnums, Object); diff --git a/formations/ai_formation.cpp b/formations/ai_formation.cpp index 6be306f..36bdc2c 100644 --- a/formations/ai_formation.cpp +++ b/formations/ai_formation.cpp @@ -75,8 +75,8 @@ AIFormation::AIFormation() { } void AIFormation::_bind_methods() { - BIND_VMETHOD(MethodInfo("_on_set_owner")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::VECTOR3, "pos"), "_get_position", PropertyInfo(Variant::INT, "slot_index"))); + GDVIRTUAL_BIND("_on_set_owner"); + GDVIRTUAL_BIND("_get_position", "slot_index"); ClassDB::bind_method(D_METHOD("get_owner"), &AIFormation::get_owner); ClassDB::bind_method(D_METHOD("set_owner", "entity"), &AIFormation::set_owner_bind); diff --git a/formations/ai_formation.h b/formations/ai_formation.h index 050c172..4572d55 100644 --- a/formations/ai_formation.h +++ b/formations/ai_formation.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + #include "scene/main/node.h" diff --git a/infos/aura_infos.h b/infos/aura_infos.h index 76c3abd..ea1b68e 100644 --- a/infos/aura_infos.h +++ b/infos/aura_infos.h @@ -25,19 +25,16 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#else -#include "core/reference.h" -#endif +#include "core/object/ref_counted.h" + #include "../entities/entity.h" class Entity; class Spell; -class AuraApplyInfo : public Reference { - GDCLASS(AuraApplyInfo, Reference); +class AuraApplyInfo : public RefCounted { + GDCLASS(AuraApplyInfo, RefCounted); public: Entity *caster_get() const; diff --git a/infos/spell_cast_info.cpp b/infos/spell_cast_info.cpp index 4209668..dd43974 100644 --- a/infos/spell_cast_info.cpp +++ b/infos/spell_cast_info.cpp @@ -205,11 +205,8 @@ Dictionary SpellCastInfo::to_dict() { return dict; } void SpellCastInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _has_cast_time = dict.get("has_cast_time", true); _cast_time = dict.get("cast_time", 0); diff --git a/infos/spell_cast_info.h b/infos/spell_cast_info.h index 7987c51..0a43d8c 100644 --- a/infos/spell_cast_info.h +++ b/infos/spell_cast_info.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" -#else -#include "core/resource.h" -#endif + class Spell; class Entity; diff --git a/inventory/bag.cpp b/inventory/bag.cpp index 3614331..b440b48 100644 --- a/inventory/bag.cpp +++ b/inventory/bag.cpp @@ -362,7 +362,7 @@ void Bag::_from_dict(const Dictionary &dict) { for (int i = 0; i < keys.size(); ++i) { Ref ii; - ii.instance(); + ii.instantiate(); ii->from_dict(items[keys.get(i)]); @@ -388,21 +388,21 @@ Bag::~Bag() { } void Bag::_bind_methods() { - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "could_add"), "_add_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); - BIND_VMETHOD(MethodInfo("_add_item_at", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::BOOL, "signal"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), "_get_item", PropertyInfo(Variant::INT, "index"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), "_remove_item", PropertyInfo(Variant::INT, "index"))); - BIND_VMETHOD(MethodInfo("_swap_items", PropertyInfo(Variant::INT, "item1_index"), PropertyInfo(Variant::INT, "item2_index"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "can"), "_can_add_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "count"), "_get_item_count")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "count"), "_get_valid_item_count")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "size"), "_get_size")); - BIND_VMETHOD(MethodInfo("_set_size", PropertyInfo(Variant::INT, "size"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "full"), "_is_full")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "overburdened"), "_is_overburdened")); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "has"), "_has_item", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemTemplate"), PropertyInfo(Variant::INT, "count"))); - BIND_VMETHOD(MethodInfo("_remove_items", PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemTemplate"), PropertyInfo(Variant::INT, "count"))); - BIND_VMETHOD(MethodInfo("_change_item_equip", PropertyInfo(Variant::INT, "slot_id"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"))); + GDVIRTUAL_BIND("_add_item", "item", "ItemInstance"); + GDVIRTUAL_BIND("_add_item_at", "index", "item", "ItemInstance", "signal"); + GDVIRTUAL_BIND("_get_item", "index"); + GDVIRTUAL_BIND("_remove_item", "index"); + GDVIRTUAL_BIND("_swap_items", "item1_index", "item2_index"); + GDVIRTUAL_BIND("_can_add_item", "item", "ItemInstance"); + GDVIRTUAL_BIND("_get_item_count"); + GDVIRTUAL_BIND("_get_valid_item_count"); + GDVIRTUAL_BIND("_get_size"); + GDVIRTUAL_BIND("_set_size", "size"); + GDVIRTUAL_BIND("_is_full"); + GDVIRTUAL_BIND("_is_overburdened"); + GDVIRTUAL_BIND("_has_item", "item", "ItemTemplate", "count"); + GDVIRTUAL_BIND("_remove_items", "item", "ItemTemplate", "count"); + GDVIRTUAL_BIND("_change_item_equip", "slot_id", "item", "ItemInstance"); ADD_SIGNAL(MethodInfo("item_added", PropertyInfo(Variant::OBJECT, "bag", PROPERTY_HINT_RESOURCE_TYPE, "Bag"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "slot_id"))); ADD_SIGNAL(MethodInfo("item_removed", PropertyInfo(Variant::OBJECT, "bag", PROPERTY_HINT_RESOURCE_TYPE, "Bag"), PropertyInfo(Variant::OBJECT, "item", PROPERTY_HINT_RESOURCE_TYPE, "ItemInstance"), PropertyInfo(Variant::INT, "slot_id"))); @@ -442,8 +442,8 @@ void Bag::_bind_methods() { ClassDB::bind_method(D_METHOD("_remove_items", "item", "count"), &Bag::_remove_items); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &Bag::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &Bag::to_dict); diff --git a/inventory/bag.h b/inventory/bag.h index 8a7052d..1d3d80b 100644 --- a/inventory/bag.h +++ b/inventory/bag.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "../item_enums.h" diff --git a/inventory/grid_bag.cpp b/inventory/grid_bag.cpp index 9489a0b..7e33364 100644 --- a/inventory/grid_bag.cpp +++ b/inventory/grid_bag.cpp @@ -193,7 +193,7 @@ Ref GridBag::get_and_remove_item(const int index) { Ref item = _items.get(index); - _items.remove(index); + _items.remove_at(index); //Go over everything, to make sure item site changes won't cause bugs. for (int x = 0; x < _size_x; ++x) { @@ -212,7 +212,7 @@ Ref GridBag::get_and_remove_item(const int index) { void GridBag::remove_item(const int index) { ERR_FAIL_INDEX(index, _items.size()); - _items.remove(index); + _items.remove_at(index); //Go over everything, to make sure item site changes won't cause bugs. for (int x = 0; x < _size_x; ++x) { @@ -230,7 +230,7 @@ void GridBag::basic_add_item(const Ref item) { _items.push_back(item); } void GridBag::basic_remove_item(const int index) { - _items.remove(index); + _items.remove_at(index); } int GridBag::get_item_count() const { diff --git a/inventory/grid_bag.h b/inventory/grid_bag.h index 57b84ca..1ff04a9 100644 --- a/inventory/grid_bag.h +++ b/inventory/grid_bag.h @@ -25,21 +25,17 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "../item_enums.h" class itemTemplate; class ItemInstance; -class GridBag : public Reference { - GDCLASS(GridBag, Reference); +class GridBag : public RefCounted { + GDCLASS(GridBag, RefCounted); public: int get_allowed_item_types() const; diff --git a/inventory/inventory.h b/inventory/inventory.h index 96dea3c..337c0ac 100644 --- a/inventory/inventory.h +++ b/inventory/inventory.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "../item_enums.h" @@ -39,8 +35,8 @@ class Player; class itemTemplate; class ItemInstance; -class Inventory : public Reference { - GDCLASS(Inventory, Reference); +class Inventory : public RefCounted { + GDCLASS(Inventory, RefCounted); public: int get_allowed_item_types() const; diff --git a/inventory/normal_bag.cpp b/inventory/normal_bag.cpp index c0b6f8b..b5e4479 100644 --- a/inventory/normal_bag.cpp +++ b/inventory/normal_bag.cpp @@ -47,7 +47,7 @@ Ref Bag::remove_item(const int index) { Ref item = _items.get(index); - _items.remove(index); + _items.remove_at(index); //Go over everything, to make sure item site changes won't cause bugs. for (int x = 0; x < _size_x; ++x) { diff --git a/inventory/normal_bag.h b/inventory/normal_bag.h index c4d7ba4..a716cd4 100644 --- a/inventory/normal_bag.h +++ b/inventory/normal_bag.h @@ -25,21 +25,17 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/templates/vector.h" -#else -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "../item_enums.h" class itemTemplate; class ItemInstance; -class Bag : public Reference { - GDCLASS(Bag, Reference); +class Bag : public RefCounted { + GDCLASS(Bag, RefCounted); public: int get_allowed_item_types() const; diff --git a/item_enums.h b/item_enums.h index f1ab225..ddd71ab 100644 --- a/item_enums.h +++ b/item_enums.h @@ -25,14 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/object/object.h" #include "core/string/ustring.h" #include "core/object/class_db.h" -#else -#include "core/object.h" -#include "core/ustring.h" -#endif + class ItemEnums : public Object { GDCLASS(ItemEnums, Object); diff --git a/material_cache/ess_material_cache.cpp b/material_cache/ess_material_cache.cpp index b689c58..0b1c0a8 100644 --- a/material_cache/ess_material_cache.cpp +++ b/material_cache/ess_material_cache.cpp @@ -38,7 +38,6 @@ SOFTWARE. #include "../singletons/ess.h" -#if VERSION_MAJOR > 3 #define VARIANT_ARRAY_GET(arr) \ Vector r; \ @@ -47,16 +46,7 @@ SOFTWARE. } \ return r; -#else -#define VARIANT_ARRAY_GET(arr) \ - Vector r; \ - for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i].get_ref_ptr()); \ - } \ - return r; - -#endif bool ESSMaterialCache::get_initialized() { return _initialized; @@ -122,7 +112,7 @@ void ESSMaterialCache::material_set(const int index, const Ref &value) } void ESSMaterialCache::material_remove(const int index) { - _materials.remove(index); + _materials.remove_at(index); } int ESSMaterialCache::material_get_num() const { @@ -161,7 +151,7 @@ void ESSMaterialCache::texture_remove(const Ref &texture) { void ESSMaterialCache::texture_remove_index(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); } void ESSMaterialCache::textures_clear() { _textures.clear(); @@ -336,7 +326,7 @@ void ESSMaterialCache::_bind_methods() { ClassDB::bind_method(D_METHOD("inc_ref_count"), &ESSMaterialCache::inc_ref_count); ClassDB::bind_method(D_METHOD("dec_ref_count"), &ESSMaterialCache::dec_ref_count); - BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"))); + GDVIRTUAL_BIND("_setup_material_albedo", "texture", "Texture"); ClassDB::bind_method(D_METHOD("material_get", "index"), &ESSMaterialCache::material_get); ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &ESSMaterialCache::material_lod_get); diff --git a/material_cache/ess_material_cache.h b/material_cache/ess_material_cache.h index e354695..6275cbd 100644 --- a/material_cache/ess_material_cache.h +++ b/material_cache/ess_material_cache.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/math/color.h" #include "core/templates/vector.h" -#else -#include "core/color.h" -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "core/math/rect2.h" #include "scene/resources/material.h" diff --git a/material_cache/ess_material_cache_pcm.cpp b/material_cache/ess_material_cache_pcm.cpp index a8b73d7..5ca0a95 100644 --- a/material_cache/ess_material_cache_pcm.cpp +++ b/material_cache/ess_material_cache_pcm.cpp @@ -163,7 +163,7 @@ void ESSMaterialCachePCM::_setup_material_albedo(Ref texture) { } ESSMaterialCachePCM::ESSMaterialCachePCM() { - _packer.instance(); + _packer.instantiate(); #if GODOT4 #warning implement diff --git a/material_cache/ess_material_cache_pcm.h b/material_cache/ess_material_cache_pcm.h index 8156b9a..e7705ef 100644 --- a/material_cache/ess_material_cache_pcm.h +++ b/material_cache/ess_material_cache_pcm.h @@ -27,15 +27,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/math/color.h" #include "core/templates/vector.h" -#else -#include "core/color.h" -#include "core/resource.h" -#include "core/vector.h" -#endif + #include "core/math/rect2.h" #include "scene/resources/material.h" diff --git a/pipelines/spell_damage_info.cpp b/pipelines/spell_damage_info.cpp index dfa54ac..47f1253 100644 --- a/pipelines/spell_damage_info.cpp +++ b/pipelines/spell_damage_info.cpp @@ -106,10 +106,10 @@ void SpellDamageInfo::receiver_set_bind(Node *value) { _receiver = e; } -Ref SpellDamageInfo::source_get() { +Ref SpellDamageInfo::source_get() { return _damage_source; } -void SpellDamageInfo::source_set(Ref value) { +void SpellDamageInfo::source_set(Ref value) { _damage_source_type = DAMAGE_SOURCE_UNKNOWN; _damage_source = value; _damage_source_id = 0; @@ -201,11 +201,8 @@ Dictionary SpellDamageInfo::to_dict() { return dict; } void SpellDamageInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _immune = dict.get("immune", true); _damage = dict.get("damage", 0); diff --git a/pipelines/spell_damage_info.h b/pipelines/spell_damage_info.h index 8b9560d..be2e7f7 100644 --- a/pipelines/spell_damage_info.h +++ b/pipelines/spell_damage_info.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#else -#include "core/reference.h" -#endif +#include "core/object/ref_counted.h" + #include "../spell_enums.h" #include "scene/main/node.h" @@ -37,8 +34,8 @@ SOFTWARE. class Entity; class Spell; -class SpellDamageInfo : public Reference { - GDCLASS(SpellDamageInfo, Reference); +class SpellDamageInfo : public RefCounted { + GDCLASS(SpellDamageInfo, RefCounted); public: enum DamageSourceType { @@ -74,8 +71,8 @@ public: void receiver_set(Entity *value); void receiver_set_bind(Node *value); - Ref source_get(); - void source_set(Ref value); + Ref source_get(); + void source_set(Ref value); Ref spell_source_get(); void spell_source_set(const Ref &value); @@ -107,7 +104,7 @@ private: int _damage_type; int _damage_source_type; - Ref _damage_source; + Ref _damage_source; int _damage_source_id; Entity *_dealer; diff --git a/pipelines/spell_heal_info.cpp b/pipelines/spell_heal_info.cpp index 63aebf5..34ee7d6 100644 --- a/pipelines/spell_heal_info.cpp +++ b/pipelines/spell_heal_info.cpp @@ -107,10 +107,10 @@ void SpellHealInfo::receiver_set_bind(Node *value) { _receiver = e; } -Ref SpellHealInfo::source_get() { +Ref SpellHealInfo::source_get() { return _heal_source; } -void SpellHealInfo::source_set(Ref value) { +void SpellHealInfo::source_set(Ref value) { _heal_source_type = HEAL_SOURCE_UNKNOWN; _heal_source = value; _heal_source_id = 0; @@ -202,11 +202,8 @@ Dictionary SpellHealInfo::to_dict() { return dict; } void SpellHealInfo::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _immune = dict.get("immune", true); _heal = dict.get("heal", 0); diff --git a/pipelines/spell_heal_info.h b/pipelines/spell_heal_info.h index 40d97d1..d50f014 100644 --- a/pipelines/spell_heal_info.h +++ b/pipelines/spell_heal_info.h @@ -25,11 +25,8 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#else -#include "core/reference.h" -#endif +#include "core/object/ref_counted.h" + #include "../spell_enums.h" #include "scene/main/node.h" @@ -37,8 +34,8 @@ SOFTWARE. class Entity; class Spell; -class SpellHealInfo : public Reference { - GDCLASS(SpellHealInfo, Reference); +class SpellHealInfo : public RefCounted { + GDCLASS(SpellHealInfo, RefCounted); public: enum HealSourceType { @@ -77,8 +74,8 @@ public: void receiver_set(Entity *value); void receiver_set_bind(Node *value); - Ref source_get(); - void source_set(Ref value); + Ref source_get(); + void source_set(Ref value); Ref spell_source_get(); void spell_source_set(const Ref &value); @@ -110,7 +107,7 @@ private: int _heal_type; int _heal_source_type; - Ref _heal_source; + Ref _heal_source; int _heal_source_id; Entity *_dealer; diff --git a/profiles/actionbar/action_bar_button_entry.cpp b/profiles/actionbar/action_bar_button_entry.cpp index efd8f41..325051e 100644 --- a/profiles/actionbar/action_bar_button_entry.cpp +++ b/profiles/actionbar/action_bar_button_entry.cpp @@ -93,11 +93,8 @@ Dictionary ActionBarButtonEntry::to_dict() const { return dict; } void ActionBarButtonEntry::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _action_bar_id = dict.get("action_bar_id", 0); _slot_id = dict.get("slot_id", 0); diff --git a/profiles/actionbar/action_bar_button_entry.h b/profiles/actionbar/action_bar_button_entry.h index 3b1ab15..593700b 100644 --- a/profiles/actionbar/action_bar_button_entry.h +++ b/profiles/actionbar/action_bar_button_entry.h @@ -25,18 +25,14 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/variant/dictionary.h" -#else -#include "core/reference.h" -#include "core/dictionary.h" -#endif + class ActionBarEntry; -class ActionBarButtonEntry : public Reference { - GDCLASS(ActionBarButtonEntry, Reference); +class ActionBarButtonEntry : public RefCounted { + GDCLASS(ActionBarButtonEntry, RefCounted); public: static const String BINDING_STRING_ACTIONBAR_BUTTON_ENTRY_TYPE; diff --git a/profiles/actionbar/action_bar_entry.cpp b/profiles/actionbar/action_bar_entry.cpp index 7543652..33e8d9e 100644 --- a/profiles/actionbar/action_bar_entry.cpp +++ b/profiles/actionbar/action_bar_entry.cpp @@ -117,11 +117,8 @@ Dictionary ActionBarEntry::to_dict() const { return dict; } void ActionBarEntry::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + for (int i = 0; i < _button_entries.size(); ++i) { _button_entries.get(i)->set_owner(NULL); @@ -136,7 +133,7 @@ void ActionBarEntry::from_dict(const Dictionary &dict) { for (int i = 0; i < arr.size(); ++i) { Ref e; - e.instance(); + e.instantiate(); e->from_dict(arr.get(i)); e->set_owner(this); diff --git a/profiles/actionbar/action_bar_entry.h b/profiles/actionbar/action_bar_entry.h index b00e847..74e72fc 100644 --- a/profiles/actionbar/action_bar_entry.h +++ b/profiles/actionbar/action_bar_entry.h @@ -25,24 +25,18 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" -#else -#include "core/reference.h" -#include "core/vector.h" -#include "core/array.h" -#include "core/dictionary.h" -#endif + #include "action_bar_button_entry.h" class ActionBarProfile; -class ActionBarEntry : public Reference { - GDCLASS(ActionBarEntry, Reference); +class ActionBarEntry : public RefCounted { + GDCLASS(ActionBarEntry, RefCounted); public: Ref get_owner(); diff --git a/profiles/actionbar/action_bar_profile.cpp b/profiles/actionbar/action_bar_profile.cpp index a3a2c4b..4b61b9e 100644 --- a/profiles/actionbar/action_bar_profile.cpp +++ b/profiles/actionbar/action_bar_profile.cpp @@ -99,7 +99,7 @@ Ref ActionBarProfile::get_action_bar(int index) { void ActionBarProfile::remove_action_bar(const int index) { _action_bars.get(index)->set_owner(NULL); - _action_bars.remove(index); + _action_bars.remove_at(index); emit_change(); } @@ -132,13 +132,9 @@ Dictionary ActionBarProfile::to_dict() const { return dict; } void ActionBarProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 if (dict.is_empty()) return; -#else - if (dict.empty()) - return; -#endif + for (int i = 0; i < _action_bars.size(); ++i) { _action_bars.get(i)->set_owner(NULL); @@ -152,7 +148,7 @@ void ActionBarProfile::from_dict(const Dictionary &dict) { for (int i = 0; i < arr.size(); ++i) { Ref e; - e.instance(); + e.instantiate(); e->from_dict(arr.get(i)); e->set_owner(this); diff --git a/profiles/actionbar/action_bar_profile.h b/profiles/actionbar/action_bar_profile.h index 49b7f3b..66c6140 100644 --- a/profiles/actionbar/action_bar_profile.h +++ b/profiles/actionbar/action_bar_profile.h @@ -25,26 +25,19 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #include "core/string/ustring.h" #include "core/variant/array.h" #include "core/variant/dictionary.h" -#else -#include "core/reference.h" -#include "core/vector.h" -#include "core/ustring.h" -#include "core/array.h" -#include "core/dictionary.h" -#endif + #include "action_bar_entry.h" class ClassProfile; -class ActionBarProfile : public Reference { - GDCLASS(ActionBarProfile, Reference); +class ActionBarProfile : public RefCounted { + GDCLASS(ActionBarProfile, RefCounted); public: Ref get_owner(); diff --git a/profiles/class_profile.cpp b/profiles/class_profile.cpp index 0c78ec8..a0986eb 100644 --- a/profiles/class_profile.cpp +++ b/profiles/class_profile.cpp @@ -127,11 +127,8 @@ Dictionary ClassProfile::to_dict() const { return dict; } void ClassProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _character_class_name = dict.get("character_class_name", ""); _class_path = dict.get("class_path", ""); @@ -148,10 +145,10 @@ void ClassProfile::from_dict(const Dictionary &dict) { } ClassProfile::ClassProfile() { - _action_bar_profile.instance(); + _action_bar_profile.instantiate(); _action_bar_profile->set_owner(this); - _input_profile.instance(); + _input_profile.instantiate(); _input_profile->set_owner(this); _level = 1; @@ -160,10 +157,10 @@ ClassProfile::ClassProfile() { } ClassProfile::ClassProfile(const StringName &class_path) { - _action_bar_profile.instance(); + _action_bar_profile.instantiate(); _action_bar_profile->set_owner(this); - _input_profile.instance(); + _input_profile.instantiate(); _input_profile->set_owner(this); _class_path = class_path; @@ -173,10 +170,10 @@ ClassProfile::ClassProfile(const StringName &class_path) { } ClassProfile::ClassProfile(const String &class_name, const StringName &class_path, const int level, const int xp, const bool locked) { - _action_bar_profile.instance(); + _action_bar_profile.instantiate(); _action_bar_profile->set_owner(this); - _input_profile.instance(); + _input_profile.instantiate(); _input_profile->set_owner(this); _character_class_name = class_name; diff --git a/profiles/class_profile.h b/profiles/class_profile.h index c5598b9..041f0ef 100644 --- a/profiles/class_profile.h +++ b/profiles/class_profile.h @@ -25,21 +25,16 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" #include "core/variant/dictionary.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#include "core/dictionary.h" -#endif + #include "actionbar/action_bar_profile.h" #include "input/input_profile.h" -class ClassProfile : public Reference { - GDCLASS(ClassProfile, Reference); +class ClassProfile : public RefCounted { + GDCLASS(ClassProfile, RefCounted); public: StringName get_class_path() const; diff --git a/profiles/input/input_profile.cpp b/profiles/input/input_profile.cpp index 15c5789..323e096 100644 --- a/profiles/input/input_profile.cpp +++ b/profiles/input/input_profile.cpp @@ -24,13 +24,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/string/ustring.h" #include "core/config/project_settings.h" -#else -#include "core/ustring.h" -#include "core/project_settings.h" -#endif + #include "../class_profile.h" diff --git a/profiles/input/input_profile.h b/profiles/input/input_profile.h index c1157e5..75a1ee1 100644 --- a/profiles/input/input_profile.h +++ b/profiles/input/input_profile.h @@ -25,18 +25,14 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#endif + class ClassProfile; -class InputProfile : public Reference { - GDCLASS(InputProfile, Reference); +class InputProfile : public RefCounted { + GDCLASS(InputProfile, RefCounted); public: Ref get_owner(); diff --git a/profiles/input/input_profile_modifier.cpp b/profiles/input/input_profile_modifier.cpp index d474007..52a0734 100644 --- a/profiles/input/input_profile_modifier.cpp +++ b/profiles/input/input_profile_modifier.cpp @@ -43,7 +43,7 @@ void InputProfileModifier::set_modifier(int index, String value) { } void InputProfileModifier::remove_modifier(int index) { - _modifier_actions->remove(index); + _modifier_actions->remove_at(index); } int InputProfileModifier::get_entry_count() { @@ -67,7 +67,7 @@ void InputProfileModifier::set_entry(int index, Ref v } void InputProfileModifier::remove_entry(int index) { - _entries->remove(index); + _entries->remove_at(index); } InputProfileModifier::InputProfileModifier() { diff --git a/profiles/input/input_profile_modifier.h b/profiles/input/input_profile_modifier.h index a70d221..dc64efd 100644 --- a/profiles/input/input_profile_modifier.h +++ b/profiles/input/input_profile_modifier.h @@ -25,20 +25,15 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #include "core/string/ustring.h" -#else -#include "core/reference.h" -#include "core/vector.h" -#include "core/ustring.h" -#endif + #include "input_profile_modifier_entry.h" -class InputProfileModifier : public Reference { - GDCLASS(InputProfileModifier, Reference); +class InputProfileModifier : public RefCounted { + GDCLASS(InputProfileModifier, RefCounted); public: int get_modifier_count(); diff --git a/profiles/input/input_profile_modifier_entry.h b/profiles/input/input_profile_modifier_entry.h index 130b4ae..9972d80 100644 --- a/profiles/input/input_profile_modifier_entry.h +++ b/profiles/input/input_profile_modifier_entry.h @@ -25,16 +25,12 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#endif -class InputProfileModifierEntry : public Reference { - GDCLASS(InputProfileModifierEntry, Reference); + +class InputProfileModifierEntry : public RefCounted { + GDCLASS(InputProfileModifierEntry, RefCounted); public: String get_action(); diff --git a/profiles/player_profile.cpp b/profiles/player_profile.cpp index 177ee73..7a79aa2 100644 --- a/profiles/player_profile.cpp +++ b/profiles/player_profile.cpp @@ -83,7 +83,7 @@ void PlayerProfile::clear_class_profiles() { void PlayerProfile::remove_class_profile(const int index) { _class_profiles.get(index)->DISCONNECT("changed", this, PlayerProfile, _on_class_profile_changed); - _class_profiles.remove(index); + _class_profiles.remove_at(index); emit_change(); } @@ -146,11 +146,8 @@ Dictionary PlayerProfile::to_dict() const { return dict; } void PlayerProfile::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + clear_class_profiles(); @@ -161,7 +158,7 @@ void PlayerProfile::from_dict(const Dictionary &dict) { for (int i = 0; i < arr.size(); ++i) { Ref c; - c.instance(); + c.instantiate(); c->from_dict(arr.get(i)); diff --git a/profiles/player_profile.h b/profiles/player_profile.h index 89b614e..63d9e38 100644 --- a/profiles/player_profile.h +++ b/profiles/player_profile.h @@ -25,20 +25,15 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" #include "core/variant/dictionary.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#include "core/dictionary.h" -#endif + #include "class_profile.h" -class PlayerProfile : public Reference { - GDCLASS(PlayerProfile, Reference); +class PlayerProfile : public RefCounted { + GDCLASS(PlayerProfile, RefCounted); public: static const String DEFAULT_PROFILE_FILE_NAME; diff --git a/register_types.cpp b/register_types.cpp index b8cc5b9..4e3a6a5 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -140,7 +140,7 @@ SOFTWARE. static ESS *entity_data_manager = NULL; static ProfileManager *profile_manager = NULL; -void register_entity_spell_system_types() { +void initialize_entity_spell_system_module(GDNativeInitializationLevel p_level) { #if PROPS_PRESENT ClassDB::register_class(); #endif @@ -280,7 +280,7 @@ void register_entity_spell_system_types() { #endif } -void unregister_entity_spell_system_types() { +void uninitialize_entity_spell_system_module(GDNativeInitializationLevel p_level) { if (entity_data_manager) { memdelete(entity_data_manager); } diff --git a/register_types.h b/register_types.h index 5c64da5..a9328f3 100644 --- a/register_types.h +++ b/register_types.h @@ -20,5 +20,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void register_entity_spell_system_types(); -void unregister_entity_spell_system_types(); +void initialize_entity_spell_system_module(ModuleInitializationLevel p_level); +void uninitialize_entity_spell_system_module(ModuleInitializationLevel p_level); diff --git a/singletons/ess.cpp b/singletons/ess.cpp index 11e4bd7..1eddb30 100644 --- a/singletons/ess.cpp +++ b/singletons/ess.cpp @@ -564,7 +564,7 @@ void ESS::material_set(const int index, const Ref &value) { } void ESS::material_remove(const int index) { - _materials.remove(index); + _materials.remove_at(index); } int ESS::material_get_num() const { diff --git a/singletons/ess.h b/singletons/ess.h index 91d8dee..dd7f447 100644 --- a/singletons/ess.h +++ b/singletons/ess.h @@ -25,19 +25,12 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/config/engine.h" #include "core/core_bind.h" #include "core/io/resource.h" #include "core/object/object.h" #include "core/string/ustring.h" -#else -#include "core/bind/core_bind.h" -#include "core/engine.h" -#include "core/object.h" -#include "core/resource.h" -#include "core/ustring.h" -#endif + #include "scene/main/node.h" @@ -286,7 +279,7 @@ private: Mutex _material_cache_mutex; - Map> _material_cache; + VMap> _material_cache; #ifdef TEXTURE_PACKER_PRESENT int _texture_flags; diff --git a/singletons/profile_manager.cpp b/singletons/profile_manager.cpp index b8865ca..be536fe 100644 --- a/singletons/profile_manager.cpp +++ b/singletons/profile_manager.cpp @@ -26,13 +26,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/config/engine.h" #include "core/config/project_settings.h" -#else -#include "core/engine.h" -#include "core/project_settings.h" -#endif + #include "../defines.h" @@ -83,7 +79,7 @@ void ProfileManager::clears_player_profiles() { _s_player_profiles.clear(); } void ProfileManager::removes_player_profile(const int index) { - _s_player_profiles.remove(index); + _s_player_profiles.remove_at(index); } Ref ProfileManager::getc_player_profile() { @@ -170,11 +166,8 @@ Dictionary ProfileManager::to_dict() const { return dict; } void ProfileManager::from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + clears_player_profiles(); @@ -186,7 +179,7 @@ void ProfileManager::from_dict(const Dictionary &dict) { for (int i = 0; i < arr.size(); ++i) { Ref c; - c.instance(); + c.instantiate(); c->from_dict(arr.get(i)); @@ -209,7 +202,7 @@ ProfileManager::ProfileManager() { _automatic_save = GLOBAL_DEF("ess/profiles/automatic_save", false); _save_file = GLOBAL_DEF("ess/profiles/save_file", "user://profile.save"); - _c_player_profile.instance(); + _c_player_profile.instantiate(); _c_player_profile->CONNECT("changed", this, ProfileManager, _on_player_profile_changed); @@ -234,8 +227,8 @@ void ProfileManager::_bind_methods() { ADD_SIGNAL(MethodInfo("keybinds_changed")); ADD_SIGNAL(MethodInfo("changed")); - BIND_VMETHOD(MethodInfo("_save")); - BIND_VMETHOD(MethodInfo("_load")); + GDVIRTUAL_BIND("_save"); + GDVIRTUAL_BIND("_load"); ClassDB::bind_method(D_METHOD("_save"), &ProfileManager::_save); ClassDB::bind_method(D_METHOD("_load"), &ProfileManager::_load); diff --git a/singletons/profile_manager.h b/singletons/profile_manager.h index 83c1d48..830ebc9 100644 --- a/singletons/profile_manager.h +++ b/singletons/profile_manager.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/object/object.h" #include "core/templates/vector.h" -#else -#include "core/object.h" -#include "core/vector.h" -#endif + #include "../profiles/player_profile.h" diff --git a/skeleton/character_skeleton_2d.cpp b/skeleton/character_skeleton_2d.cpp index d287508..4050abd 100644 --- a/skeleton/character_skeleton_2d.cpp +++ b/skeleton/character_skeleton_2d.cpp @@ -201,7 +201,7 @@ void CharacterSkeleton2D::remove_model_visual(Ref vis) { remove_model_visual_entry(vis, e); } - _model_visuals.remove(index); + _model_visuals.remove_at(index); set_process(true); _model_dirty = true; @@ -212,7 +212,7 @@ void CharacterSkeleton2D::remove_model_visual_index(int index) { set_process(true); _model_dirty = true; - _model_visuals.remove(index); + _model_visuals.remove_at(index); } Ref CharacterSkeleton2D::get_model_visual(int index) { ERR_FAIL_INDEX_V(index, _model_visuals.size(), Ref()); @@ -268,7 +268,7 @@ void CharacterSkeleton2D::add_model_visual_entry(Ref vis, Ref e; - e.instance(); + e.instantiate(); e->set_priority(vis->get_layer()); //e->set_color(ive->get_color()); @@ -551,7 +551,7 @@ void CharacterSkeleton2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_model_visual_count"), &CharacterSkeleton2D::get_model_visual_count); ClassDB::bind_method(D_METHOD("clear_model_visuals"), &CharacterSkeleton2D::clear_model_visuals); - BIND_VMETHOD(MethodInfo("_build_model")); + GDVIRTUAL_BIND("_build_model"); ClassDB::bind_method(D_METHOD("get_model_dirty"), &CharacterSkeleton2D::get_model_dirty); ClassDB::bind_method(D_METHOD("set_model_dirty", "value"), &CharacterSkeleton2D::set_model_dirty); @@ -586,7 +586,7 @@ void CharacterSkeleton2D::_bind_methods() { ClassDB::bind_method(D_METHOD("attach_point_count"), &CharacterSkeleton2D::attach_point_count); - BIND_VMETHOD(MethodInfo("_common_attach_point_index_get", PropertyInfo(Variant::INT, "point", PROPERTY_HINT_NONE, EntityEnums::BINDING_STRING_COMMON_CHARCATER_SKELETON_POINTS))); + GDVIRTUAL_BIND("_common_attach_point_index_get", "point", PROPERTY_HINT_NONE, EntityEnums::BINDING_STRING_COMMON_CHARCATER_SKELETON_POINTS); ClassDB::bind_method(D_METHOD("common_attach_point_node_get", "point"), &CharacterSkeleton2D::common_attach_point_node_get); ClassDB::bind_method(D_METHOD("common_attach_point_add", "point", "scene"), &CharacterSkeleton2D::common_attach_point_add); diff --git a/skeleton/character_skeleton_2d.h b/skeleton/character_skeleton_2d.h index 7b2e06e..1bf7796 100644 --- a/skeleton/character_skeleton_2d.h +++ b/skeleton/character_skeleton_2d.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/templates/vector.h" #include "core/string/ustring.h" #include "core/string/node_path.h" -#else -#include "core/vector.h" -#include "core/ustring.h" -#include "core/node_path.h" -#endif + #include "scene/2d/node_2d.h" diff --git a/skeleton/character_skeleton_3d.cpp b/skeleton/character_skeleton_3d.cpp index 07d768a..6af7c97 100644 --- a/skeleton/character_skeleton_3d.cpp +++ b/skeleton/character_skeleton_3d.cpp @@ -182,23 +182,23 @@ void CharacterSkeleton3D::bone_additional_mesh_transform_bone_index_set(const in _bone_model_additional_mesh_transforms.write[index].bone_index = bone_index; } -Transform CharacterSkeleton3D::bone_additional_mesh_transform_transform_get(const int index) const { - ERR_FAIL_INDEX_V(index, _bone_model_additional_mesh_transforms.size(), Transform()); +Transform3D CharacterSkeleton3D::bone_additional_mesh_transform_transform_get(const int index) const { + ERR_FAIL_INDEX_V(index, _bone_model_additional_mesh_transforms.size(), Transform3D()); return _bone_model_additional_mesh_transforms[index].transform; } -void CharacterSkeleton3D::bone_additional_mesh_transform_transform_set(const int index, const Transform &transform) { +void CharacterSkeleton3D::bone_additional_mesh_transform_transform_set(const int index, const Transform3D &transform) { ERR_FAIL_INDEX(index, _bone_model_additional_mesh_transforms.size()); _bone_model_additional_mesh_transforms.write[index].transform = transform; } -Transform CharacterSkeleton3D::bone_additional_mesh_transform_user_transform_get(const int index) const { - ERR_FAIL_INDEX_V(index, _bone_model_additional_mesh_transforms.size(), Transform()); +Transform3D CharacterSkeleton3D::bone_additional_mesh_transform_user_transform_get(const int index) const { + ERR_FAIL_INDEX_V(index, _bone_model_additional_mesh_transforms.size(), Transform3D()); return _bone_model_additional_mesh_transforms[index].user_transform; } -void CharacterSkeleton3D::bone_additional_mesh_transform_user_transform_set(const int index, const Transform &transform) { +void CharacterSkeleton3D::bone_additional_mesh_transform_user_transform_set(const int index, const Transform3D &transform) { ERR_FAIL_INDEX(index, _bone_model_additional_mesh_transforms.size()); _bone_model_additional_mesh_transforms.write[index].user_transform = transform; @@ -241,7 +241,7 @@ void CharacterSkeleton3D::remove_model_visual(Ref vis) { remove_model_visual_entry(vis, e); } - _model_visuals.remove(index); + _model_visuals.remove_at(index); set_process(true); _model_dirty = true; @@ -252,7 +252,7 @@ void CharacterSkeleton3D::remove_model_visual_index(int index) { set_process(true); _model_dirty = true; - _model_visuals.remove(index); + _model_visuals.remove_at(index); } Ref CharacterSkeleton3D::get_model_visual(int index) { ERR_FAIL_INDEX_V(index, _model_visuals.size(), Ref()); @@ -308,7 +308,7 @@ void CharacterSkeleton3D::add_model_visual_entry(Ref vis, Ref e; - e.instance(); + e.instantiate(); e->set_priority(vis->get_layer()); //e->set_color(ive->get_color()); @@ -551,13 +551,13 @@ bool CharacterSkeleton3D::_set(const StringName &p_name, const Variant &p_value) return true; } else if (p == "transform") { - Transform tf = p_value; + Transform3D tf = p_value; _bone_model_additional_mesh_transforms.write[index].transform = tf; return true; } else if (p == "user_transform") { - Transform tf = p_value; + Transform3D tf = p_value; _bone_model_additional_mesh_transforms.write[index].user_transform = tf; @@ -624,8 +624,8 @@ void CharacterSkeleton3D::_get_property_list(List *p_list) const { for (int i = 0; i < _bone_model_additional_mesh_transforms.size(); ++i) { p_list->push_back(PropertyInfo(Variant::INT, "bone_model_additional_mesh_transforms/" + itos(i) + "/bone_index", PROPERTY_HINT_ENUM, ESS::get_singleton()->skeletons_bones_index_get(_entity_type))); - p_list->push_back(PropertyInfo(Variant::TRANSFORM, "bone_model_additional_mesh_transforms/" + itos(i) + "/transform")); - p_list->push_back(PropertyInfo(Variant::TRANSFORM, "bone_model_additional_mesh_transforms/" + itos(i) + "/user_transform")); + p_list->push_back(PropertyInfo(Variant::TRANSFORM3D, "bone_model_additional_mesh_transforms/" + itos(i) + "/transform")); + p_list->push_back(PropertyInfo(Variant::TRANSFORM3D, "bone_model_additional_mesh_transforms/" + itos(i) + "/user_transform")); } } @@ -651,7 +651,7 @@ void CharacterSkeleton3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_model_visual_count"), &CharacterSkeleton3D::get_model_visual_count); ClassDB::bind_method(D_METHOD("clear_model_visuals"), &CharacterSkeleton3D::clear_model_visuals); - BIND_VMETHOD(MethodInfo("_build_model")); + GDVIRTUAL_BIND("_build_model"); ClassDB::bind_method(D_METHOD("get_model_dirty"), &CharacterSkeleton3D::get_model_dirty); ClassDB::bind_method(D_METHOD("set_model_dirty", "value"), &CharacterSkeleton3D::set_model_dirty); @@ -700,7 +700,7 @@ void CharacterSkeleton3D::_bind_methods() { ClassDB::bind_method(D_METHOD("attach_point_count"), &CharacterSkeleton3D::attach_point_count); - BIND_VMETHOD(MethodInfo("_common_attach_point_index_get", PropertyInfo(Variant::INT, "point", PROPERTY_HINT_NONE, EntityEnums::BINDING_STRING_COMMON_CHARCATER_SKELETON_POINTS))); + GDVIRTUAL_BIND("_common_attach_point_index_get", "point", PROPERTY_HINT_NONE, EntityEnums::BINDING_STRING_COMMON_CHARCATER_SKELETON_POINTS); ClassDB::bind_method(D_METHOD("common_attach_point_node_get", "point"), &CharacterSkeleton3D::common_attach_point_node_get); ClassDB::bind_method(D_METHOD("common_attach_point_add", "point", "scene"), &CharacterSkeleton3D::common_attach_point_add); diff --git a/skeleton/character_skeleton_3d.h b/skeleton/character_skeleton_3d.h index 4ab5f24..92a6679 100644 --- a/skeleton/character_skeleton_3d.h +++ b/skeleton/character_skeleton_3d.h @@ -25,15 +25,10 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/templates/vector.h" #include "core/string/ustring.h" #include "core/string/node_path.h" -#else -#include "core/vector.h" -#include "core/ustring.h" -#include "core/node_path.h" -#endif + #include "scene/main/node.h" @@ -98,11 +93,11 @@ public: int bone_additional_mesh_transform_bone_index_get(const int index) const; void bone_additional_mesh_transform_bone_index_set(const int index, const int bone_index); - Transform bone_additional_mesh_transform_transform_get(const int index) const; - void bone_additional_mesh_transform_transform_set(const int index, const Transform &transform); + Transform3D bone_additional_mesh_transform_transform_get(const int index) const; + void bone_additional_mesh_transform_transform_set(const int index, const Transform3D &transform); - Transform bone_additional_mesh_transform_user_transform_get(const int index) const; - void bone_additional_mesh_transform_user_transform_set(const int index, const Transform &transform); + Transform3D bone_additional_mesh_transform_user_transform_get(const int index) const; + void bone_additional_mesh_transform_user_transform_set(const int index, const Transform3D &transform); void bone_additional_mesh_transform_set_count(const int size); int bone_additional_mesh_transform_get_count() const; @@ -161,8 +156,8 @@ protected: struct BoneModelAdditionalMeshTransforms { int bone_index; - Transform transform; - Transform user_transform; + Transform3D transform; + Transform3D user_transform; BoneModelAdditionalMeshTransforms() { bone_index = 0; diff --git a/skeleton/entity_skeleton_data.h b/skeleton/entity_skeleton_data.h index 1ecedd3..3b7a847 100644 --- a/skeleton/entity_skeleton_data.h +++ b/skeleton/entity_skeleton_data.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/io/resource.h" #include "core/string/ustring.h" -#else -#include "core/resource.h" -#include "core/ustring.h" -#endif + class EntitySkeletonData : public Resource { GDCLASS(EntitySkeletonData, Resource); diff --git a/skeleton/skeleton_model_entry.h b/skeleton/skeleton_model_entry.h index 09a4a53..7a50eec 100644 --- a/skeleton/skeleton_model_entry.h +++ b/skeleton/skeleton_model_entry.h @@ -25,16 +25,13 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" -#else -#include "core/reference.h" -#endif +#include "core/object/ref_counted.h" + #include "../data/items/model_visual_entry.h" -class SkeletonModelEntry : public Reference { - GDCLASS(SkeletonModelEntry, Reference); +class SkeletonModelEntry : public RefCounted { + GDCLASS(SkeletonModelEntry, RefCounted); public: int get_count() const; diff --git a/spawners/ess_entity_spawner.cpp b/spawners/ess_entity_spawner.cpp index e65aef3..6f34ca6 100644 --- a/spawners/ess_entity_spawner.cpp +++ b/spawners/ess_entity_spawner.cpp @@ -49,7 +49,7 @@ ESSEntitySpawner::~ESSEntitySpawner() { } void ESSEntitySpawner::_bind_methods() { - BIND_VMETHOD(MethodInfo("_request_entity_spawn", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "EntityCreateInfo"))); + GDVIRTUAL_BIND("_request_entity_spawn", "info", "EntityCreateInfo"); ADD_SIGNAL(MethodInfo("on_entity_spawn", PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "EntityCreateInfo"))); ClassDB::bind_method(D_METHOD("request_entity_spawn", "info"), &ESSEntitySpawner::request_entity_spawn); diff --git a/spell_enums.h b/spell_enums.h index e39b3a1..cc2d22f 100644 --- a/spell_enums.h +++ b/spell_enums.h @@ -25,12 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 #include "core/object/object.h" #include "core/object/class_db.h" -#else -#include "core/object.h" -#endif + class SpellEnums : public Object { GDCLASS(SpellEnums, Object); diff --git a/utility/entity_create_info.cpp b/utility/entity_create_info.cpp index 9915835..fdadd74 100644 --- a/utility/entity_create_info.cpp +++ b/utility/entity_create_info.cpp @@ -98,10 +98,10 @@ void EntityCreateInfo::set_xp(const int value) { _xp = value; } -Transform EntityCreateInfo::get_transform() const { +Transform3D EntityCreateInfo::get_transform() const { return _transform; } -void EntityCreateInfo::set_transform(const Transform &value) { +void EntityCreateInfo::set_transform(const Transform3D &value) { _transform = value; } @@ -190,11 +190,8 @@ Dictionary EntityCreateInfo::_to_dict() { return dict; } void EntityCreateInfo::_from_dict(const Dictionary &dict) { -#if VERSION_MAJOR > 3 ERR_FAIL_COND(dict.is_empty()); -#else - ERR_FAIL_COND(dict.empty()); -#endif + _guid = dict.get("guid", 0); _networked = dict.get("networked", false); @@ -205,7 +202,7 @@ void EntityCreateInfo::_from_dict(const Dictionary &dict) { _entity_name = dict.get("entity_name", ""); _level = dict.get("level", 0); _xp = dict.get("xp", 0); - _transform = dict.get("transform", Transform()); + _transform = dict.get("transform", Transform3D()); _transform2d = dict.get("transform2d", Transform2D()); _species_instance = dict.get("species_instance", Ref()); _serialized_data = dict.get("serialized_data", Dictionary()); @@ -272,11 +269,11 @@ void EntityCreateInfo::_bind_methods() { ClassDB::bind_method(D_METHOD("get_transform"), &EntityCreateInfo::get_transform); ClassDB::bind_method(D_METHOD("set_transform", "value"), &EntityCreateInfo::set_transform); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform"), "set_transform", "get_transform"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "transform"), "set_transform", "get_transform"); ClassDB::bind_method(D_METHOD("get_transform2d"), &EntityCreateInfo::get_transform2d); ClassDB::bind_method(D_METHOD("set_transform2d", "value"), &EntityCreateInfo::set_transform2d); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform2d"), "set_transform2d", "get_transform2d"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D2D, "transform2d"), "set_transform2d", "get_transform2d"); ClassDB::bind_method(D_METHOD("get_entity_data"), &EntityCreateInfo::get_entity_data); ClassDB::bind_method(D_METHOD("set_entity_data", "value"), &EntityCreateInfo::set_entity_data); @@ -299,8 +296,8 @@ void EntityCreateInfo::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "created_entity", PROPERTY_HINT_RESOURCE_TYPE, "Entity"), "set_created_entity", "get_created_entity"); //Serialization - BIND_VMETHOD(MethodInfo("_from_dict", PropertyInfo(Variant::DICTIONARY, "dict"))); - BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::DICTIONARY, "dict"), "_to_dict")); + GDVIRTUAL_BIND("_from_dict", "dict"); + GDVIRTUAL_BIND("_to_dict"); ClassDB::bind_method(D_METHOD("from_dict", "dict"), &EntityCreateInfo::from_dict); ClassDB::bind_method(D_METHOD("to_dict"), &EntityCreateInfo::to_dict); diff --git a/utility/entity_create_info.h b/utility/entity_create_info.h index b958b46..0bfdde4 100644 --- a/utility/entity_create_info.h +++ b/utility/entity_create_info.h @@ -25,13 +25,9 @@ SOFTWARE. #include "core/version.h" -#if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/string/ustring.h" -#else -#include "core/reference.h" -#include "core/ustring.h" -#endif + #include "../entity_enums.h" @@ -39,8 +35,8 @@ class EntityData; class SpeciesInstance; class Entity; -class EntityCreateInfo : public Reference { - GDCLASS(EntityCreateInfo, Reference); +class EntityCreateInfo : public RefCounted { + GDCLASS(EntityCreateInfo, RefCounted); public: int get_guid() const; @@ -73,8 +69,8 @@ public: int get_xp() const; void set_xp(const int value); - Transform get_transform() const; - void set_transform(const Transform &value); + Transform3D get_transform() const; + void set_transform(const Transform3D &value); Transform2D get_transform2d() const; void set_transform2d(const Transform2D &value); @@ -118,7 +114,7 @@ private: int _level; int _xp; - Transform _transform; + Transform3D _transform; Transform2D _transform2d; Ref _entity_data;