Added deferred versions of request_world_spell_spawn, and request_world_spell.

This commit is contained in:
Relintai 2020-02-16 16:17:19 +01:00
parent 0bdf71c431
commit a73f61628b
2 changed files with 10 additions and 0 deletions

View File

@ -936,9 +936,15 @@ void EntityDataManager::load_entity_species_datas() {
void EntityDataManager::request_entity_spawn(const Ref<EntityCreateInfo> &info) {
emit_signal("on_entity_spawn_requested", info);
}
void EntityDataManager::request_entity_spawn_deferred(const Ref<EntityCreateInfo> &info) {
call_deferred("emit_signal", "on_entity_spawn_requested", info);
}
void EntityDataManager::request_world_spell_spawn(const Ref<WorldSpellData> &data, const Ref<SpellCastInfo> &info) {
emit_signal("on_world_spell_spawn_requested", data, info);
}
void EntityDataManager::request_world_spell_spawn_deferred(const Ref<WorldSpellData> &data, const Ref<SpellCastInfo> &info) {
call_deferred("emit_signal", "on_world_spell_spawn_requested", data, info);
}
void EntityDataManager::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_skill_for_armor_type", "index"), &EntityDataManager::get_skill_for_armor_type);
@ -1088,7 +1094,9 @@ void EntityDataManager::_bind_methods() {
ADD_SIGNAL(MethodInfo("on_world_spell_spawn_requested", PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "WorldSpellData"), PropertyInfo(Variant::OBJECT, "info", PROPERTY_HINT_RESOURCE_TYPE, "SpellCastInfo")));
ClassDB::bind_method(D_METHOD("request_entity_spawn", "info"), &EntityDataManager::request_entity_spawn);
ClassDB::bind_method(D_METHOD("request_entity_spawn_deferred", "info"), &EntityDataManager::request_entity_spawn_deferred);
ClassDB::bind_method(D_METHOD("request_world_spell_spawn", "data", "info"), &EntityDataManager::request_world_spell_spawn);
ClassDB::bind_method(D_METHOD("request_world_spell_spawn_deferred", "data", "info"), &EntityDataManager::request_world_spell_spawn_deferred);
}
EntityDataManager::EntityDataManager() {

View File

@ -175,7 +175,9 @@ public:
void load_entity_species_datas();
void request_entity_spawn(const Ref<EntityCreateInfo> &info);
void request_entity_spawn_deferred(const Ref<EntityCreateInfo> &info);
void request_world_spell_spawn(const Ref<WorldSpellData> &data, const Ref<SpellCastInfo> &info);
void request_world_spell_spawn_deferred(const Ref<WorldSpellData> &data, const Ref<SpellCastInfo> &info);
EntityDataManager();
~EntityDataManager();