Renamed EntityRace to EntitySpeciesData. Added SpeciesModelData. Small changes.

This commit is contained in:
Relintai 2019-10-25 10:22:57 +02:00
parent 82893c5a61
commit f4341a1d51
12 changed files with 410 additions and 109 deletions

3
SCsub
View File

@ -92,6 +92,9 @@ module_env.add_source_files(env.modules_sources,"drag_and_drop/es_drag_and_drop.
module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton.cpp")
module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton_3d.cpp")
module_env.add_source_files(env.modules_sources,"skeleton/entity_species_data.cpp")
module_env.add_source_files(env.modules_sources,"skeleton/species_model_data.cpp")
module_env.add_source_files(env.modules_sources,"utility/entity_create_info.cpp")
module_env.add_source_files(env.modules_sources,"utility/cooldown.cpp")

View File

@ -77,6 +77,9 @@
#include "skeleton/character_skeleton.h"
#include "skeleton/character_skeleton_3d.h"
#include "skeleton/species_model_data.h"
#include "skeleton/entity_species_data.h"
#include "utility/entity_create_info.h"
#include "utility/cooldown.h"
#include "utility/cooldown.h"
@ -211,6 +214,9 @@ void register_entity_spell_system_types() {
ClassDB::register_class<CharacterSkeleton>();
ClassDB::register_class<CharacterSkeleton3D>();
ClassDB::register_class<EntitySpeciesData>();
ClassDB::register_class<SpeciesModelData>();
ClassDB::register_class<Cooldown>();
ClassDB::register_class<CategoryCooldown>();

View File

@ -15,6 +15,8 @@
#include "../data/character_skeleton_visual_entry.h"
#include "../entity_enums.h"
#include "../data/item_visual.h"
#ifdef ENTITIES_2D
class CharacterSkeleton : public Node2D {
@ -28,6 +30,12 @@ class CharacterSkeleton : public Spatial {
#endif
public:
virtual void add_item_visual(Ref<ItemVisual> vis);
virtual void remove_item_visual(Ref<ItemVisual> vis);
virtual Ref<ItemVisual> get_item_visual();
virtual int get_item_visual_count();
virtual void clear_item_visuals();
CharacterSkeleton();
protected:

View File

@ -3,6 +3,8 @@
#include "character_skeleton.h"
#include "core/vector.h"
#include "core/node_path.h"
#include "core/ustring.h"
#include "scene/animation/animation_player.h"
@ -35,6 +37,12 @@ public:
AnimationTree *get_animation_tree();
void add_item_visual(Ref<ItemVisual> vis);
void remove_item_visual(Ref<ItemVisual> vis);
Ref<ItemVisual> get_item_visual();
int get_item_visual_count();
void clear_item_visuals();
void update_nodes();
CharacterSkeleton3D();
@ -57,6 +65,8 @@ private:
Vector<Ref<ItemVisual> > _item_visuals;
Ref<CharacterSkeletonVisualEntry> _visuals[EntityEnums::SKELETON_POINTS_MAX];
Vector<Ref<CharacterSkeletonVisualEntry> > _entries[EntityEnums::SKELETON_POINTS_MAX];
};

View File

@ -1,26 +0,0 @@
#include "character_skeleton_slot.h"
void CharacterSkeletonSlot::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_bone_path", "index"), &CharacterSkeleton::get_bone_path);
ClassDB::bind_method(D_METHOD("set_bone_path", "index", "path"), &CharacterSkeleton::set_bone_path);
ADD_GROUP("Bone Paths", "bone_path_");
ADD_PROPERTYI(PropertyInfo(Variant::NODE_PATH, "bone_path_hip"), "set_bone_path", "get_bone_path", EntityEnums::SKELETON_POINT_HIP);
ClassDB::bind_method(D_METHOD("get_bone_node", "bone_idx"), &CharacterSkeleton::get_bone_node);
ClassDB::bind_method(D_METHOD("get_animation_player_path"), &CharacterSkeleton::get_animation_player_path);
ClassDB::bind_method(D_METHOD("set_animation_player_path", "path"), &CharacterSkeleton::set_animation_player_path);
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "animation_player_path"), "set_animation_player_path", "get_animation_player_path");
ClassDB::bind_method(D_METHOD("get_animation_tree_path"), &CharacterSkeleton::get_animation_tree_path);
ClassDB::bind_method(D_METHOD("set_animation_tree_path", "path"), &CharacterSkeleton::set_animation_tree_path);
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "animation_tree_path"), "set_animation_tree_path", "get_animation_tree_path");
ClassDB::bind_method(D_METHOD("get_animation_player"), &CharacterSkeleton::get_animation_player);
ClassDB::bind_method(D_METHOD("get_animation_tree"), &CharacterSkeleton::get_animation_tree);
ClassDB::bind_method(D_METHOD("update_nodes"), &CharacterSkeleton::update_nodes);
}

View File

@ -1,33 +0,0 @@
#ifndef CHARACTER_SKELETON_H
#define CHARACTER_SKELETON_H
#ifdef ENTITIES_2D
#include "scene/2d/node_2d.h"
#else
#include "scene/3d/spatial.h"
#endif
#include "core/node_path.h"
#include "core/ustring.h"
#include "scene/animation/animation_player.h"
#include "scene/animation/animation_tree.h"
#include "../data/character_skeleton_visual_entry.h"
#include "../entity_enums.h"
class CharacterSkeletonSlot : public Reference {
GDCLASS(CharacterSkeletonSlot, Reference);
public:
CharacterSkeleton();
protected:
static void _bind_methods();
private:
Ref<CharacterSkeletonVisualEntry> _attachments[EntityEnums::SKELETON_POINTS_MAX];
};
#endif

View File

@ -1,8 +0,0 @@
#include "entity_race.h"
void EntityRace::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::STRING, "_generate_name", PropertyInfo(Variant::INT, "seed")));
BIND_CONSTANT(MAX_SKIN_COLORS);
}

View File

@ -1,42 +0,0 @@
#ifndef ENTITY_RACE_H
#define ENTITY_RACE_H
#include "core/resource.h"
#include "core/ustring.h"
class Spell;
class Aura;
class EntityRace : public Resource {
GDCLASS(EntityRace, Resource);
public:
enum {
MAX_SKIN_COLORS = 10,
MAX_SPELLS = 10,
MAX_AURAS = 10
};
enum EntityRaceType {
ENTITY_RACE_TYPE_NONE,
ENTITY_RACE_TYPE_HUMANOID,
ENTITY_RACE_TYPE_BEAST
};
String generate_name(int seed);
protected:
static void _bind_methods();
private:
String _name;
String _description;
//Ref<SkeletonData> _skeleton_data;
Color _preset_skin_colors[MAX_SKIN_COLORS];
Ref<Spell> _spells[MAX_SPELLS];
Ref<Aura> _auras[MAX_AURAS];
EntityRaceType _type;
};
#endif

View File

@ -0,0 +1,190 @@
#include "entity_species_data.h"
#include "../data/spell.h"
#include "../data/aura.h"
int EntitySpeciesData::get_id() {
return _id;
}
void EntitySpeciesData::set_id(int value) {
_id = value;
}
EntityEnums::EntityType EntitySpeciesData::get_type() {
return _type;
}
void EntitySpeciesData::set_type(EntityEnums::EntityType value) {
_type = value;
}
String EntitySpeciesData::get_text_name() {
return _text_name;
}
void EntitySpeciesData::set_text_name(String value) {
_text_name = value;
}
String EntitySpeciesData::get_text_description() {
return _text_description;
}
void EntitySpeciesData::set_text_description(String value) {
_text_description = value;
}
Ref<SpeciesModelData> EntitySpeciesData::get_model_data() {
return _model_data;
}
void EntitySpeciesData::set_model_data(Ref<SpeciesModelData> data) {
_model_data = data;
}
//Spells
Ref<Spell> EntitySpeciesData::get_spell(const int index) const {
ERR_FAIL_INDEX_V(index, _spells.size(), Ref<Spell>());
return _spells.get(index);
}
void EntitySpeciesData::set_spell(const int index, const Ref<Spell> spell) {
ERR_FAIL_INDEX(index, _spells.size());
_spells.set(index, spell);
}
void EntitySpeciesData::add_spell(const Ref<Spell> spell) {
_spells.push_back(spell);
}
void EntitySpeciesData::remove_spell(const int index) {
ERR_FAIL_INDEX(index, _spells.size());
_spells.remove(index);
}
int EntitySpeciesData::get_spell_count() const {
return _spells.size();
}
Vector<Variant> EntitySpeciesData::get_spells() {
Vector<Variant> r;
for (int i = 0; i < _spells.size(); i++) {
r.push_back(_spells[i].get_ref_ptr());
}
return r;
}
void EntitySpeciesData::set_spells(const Vector<Variant> &spells) {
_spells.clear();
for (int i = 0; i < spells.size(); i++) {
Ref<Spell> spell = Ref<Spell>(spells[i]);
_spells.push_back(spell);
}
}
//Auras
Ref<Aura> EntitySpeciesData::get_aura(const int index) const {
ERR_FAIL_INDEX_V(index, _auras.size(), Ref<Aura>());
return _auras.get(index);
}
void EntitySpeciesData::set_aura(const int index, const Ref<Aura> aura) {
ERR_FAIL_INDEX(index, _auras.size());
_auras.set(index, aura);
}
void EntitySpeciesData::add_aura(const Ref<Aura> aura) {
_auras.push_back(aura);
}
void EntitySpeciesData::remove_aura(const int index) {
ERR_FAIL_INDEX(index, _auras.size());
_auras.remove(index);
}
int EntitySpeciesData::get_aura_count() const {
return _auras.size();
}
Vector<Variant> EntitySpeciesData::get_auras() {
Vector<Variant> r;
for (int i = 0; i < _auras.size(); i++) {
r.push_back(_auras[i].get_ref_ptr());
}
return r;
}
void EntitySpeciesData::set_auras(const Vector<Variant> &auras) {
_auras.clear();
for (int i = 0; i < auras.size(); i++) {
Ref<Aura> aura = Ref<Aura>(auras[i]);
_auras.push_back(aura);
}
}
String EntitySpeciesData::generate_name(int seed) {
if (has_method("_generate_name")) {
return call("_generate_name", seed);
}
return "";
}
EntitySpeciesData::EntitySpeciesData() {
_id = 0;
_type = EntityEnums::ENITIY_TYPE_NONE;
}
EntitySpeciesData::~EntitySpeciesData() {
_model_data.unref();
_spells.clear();
_auras.clear();
}
void EntitySpeciesData::_bind_methods() {
BIND_VMETHOD(MethodInfo(Variant::STRING, "_generate_name", PropertyInfo(Variant::INT, "seed")));
ClassDB::bind_method(D_METHOD("generate_name"), &EntitySpeciesData::generate_name);
ClassDB::bind_method(D_METHOD("get_id"), &EntitySpeciesData::get_id);
ClassDB::bind_method(D_METHOD("set_id", "value"), &EntitySpeciesData::set_id);
ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id");
ClassDB::bind_method(D_METHOD("get_type"), &EntitySpeciesData::get_type);
ClassDB::bind_method(D_METHOD("set_type", "value"), &EntitySpeciesData::set_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, EntityEnums::BINDING_STRING_ENTITY_TYPES), "set_type", "get_type");
ClassDB::bind_method(D_METHOD("get_text_name"), &EntitySpeciesData::get_text_name);
ClassDB::bind_method(D_METHOD("set_text_name", "value"), &EntitySpeciesData::set_text_name);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_name"), "set_text_name", "get_text_name");
ClassDB::bind_method(D_METHOD("get_text_description"), &EntitySpeciesData::get_text_description);
ClassDB::bind_method(D_METHOD("set_text_description", "value"), &EntitySpeciesData::set_text_description);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_description"), "set_text_description", "get_text_description");
ClassDB::bind_method(D_METHOD("get_model_data"), &EntitySpeciesData::get_model_data);
ClassDB::bind_method(D_METHOD("set_model_data", "value"), &EntitySpeciesData::set_model_data);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "model_data", PROPERTY_HINT_RESOURCE_TYPE, "SpeciesModelData"), "set_model_data", "get_model_data");
//Spells
ClassDB::bind_method(D_METHOD("get_spell", "index"), &EntitySpeciesData::get_spell);
ClassDB::bind_method(D_METHOD("set_spell", "index", "data"), &EntitySpeciesData::set_spell);
ClassDB::bind_method(D_METHOD("add_spell", "spell"), &EntitySpeciesData::add_spell);
ClassDB::bind_method(D_METHOD("remove_spell", "index"), &EntitySpeciesData::remove_spell);
ClassDB::bind_method(D_METHOD("get_spell_count"), &EntitySpeciesData::get_spell_count);
ClassDB::bind_method(D_METHOD("get_spells"), &EntitySpeciesData::get_spells);
ClassDB::bind_method(D_METHOD("set_spells", "spells"), &EntitySpeciesData::set_spells);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "spells", PROPERTY_HINT_NONE, "17/17:Spell", PROPERTY_USAGE_DEFAULT, "Spell"), "set_spells", "get_spells");
//Auras
ClassDB::bind_method(D_METHOD("get_aura", "index"), &EntitySpeciesData::get_aura);
ClassDB::bind_method(D_METHOD("set_aura", "index", "data"), &EntitySpeciesData::set_aura);
ClassDB::bind_method(D_METHOD("add_aura", "aura"), &EntitySpeciesData::add_aura);
ClassDB::bind_method(D_METHOD("remove_aura", "index"), &EntitySpeciesData::remove_aura);
ClassDB::bind_method(D_METHOD("get_aura_count"), &EntitySpeciesData::get_aura_count);
ClassDB::bind_method(D_METHOD("get_auras"), &EntitySpeciesData::get_auras);
ClassDB::bind_method(D_METHOD("set_auras", "auras"), &EntitySpeciesData::set_auras);
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "auras", PROPERTY_HINT_NONE, "17/17:Aura", PROPERTY_USAGE_DEFAULT, "Aura"), "set_auras", "get_auras");
}

View File

@ -0,0 +1,77 @@
#ifndef ENTITY_SPECIES_DATA_H
#define ENTITY_SPECIES_DATA_H
#include "core/resource.h"
#include "core/ustring.h"
#include "core/vector.h"
#include "../entity_enums.h"
#include "species_model_data.h"
class Spell;
class Aura;
class EntitySpeciesData : public Resource {
GDCLASS(EntitySpeciesData, Resource);
public:
int get_id();
void set_id(int value);
EntityEnums::EntityType get_type();
void set_type(EntityEnums::EntityType value);
String get_text_name();
void set_text_name(String value);
String get_text_description();
void set_text_description(String value);
Ref<SpeciesModelData> get_model_data();
void set_model_data(Ref<SpeciesModelData> data);
//Spells
Ref<Spell> get_spell(const int index) const;
void set_spell(const int index, const Ref<Spell> spell);
void add_spell(const Ref<Spell> spell);
void remove_spell(const int index);
int get_spell_count() const;
Vector<Variant> get_spells();
void set_spells(const Vector<Variant> &spells);
//Auras
Ref<Aura> get_aura(const int index) const;
void set_aura(const int index, const Ref<Aura> aura);
void add_aura(const Ref<Aura> aura);
void remove_aura(const int index);
int get_aura_count() const;
Vector<Variant> get_auras();
void set_auras(const Vector<Variant> &auras);
String generate_name(int seed);
EntitySpeciesData();
~EntitySpeciesData();
protected:
static void _bind_methods();
private:
int _id;
EntityEnums::EntityType _type;
String _text_name;
String _text_description;
Ref<SpeciesModelData> _model_data;
Vector<Ref<Spell> > _spells;
Vector<Ref<Aura> > _auras;
};
#endif

View File

@ -0,0 +1,69 @@
#include "species_model_data.h"
SpeciesModelData::SpeciesModelData() {
}
SpeciesModelData::~SpeciesModelData() {
}
void SpeciesModelData::_bind_methods() {
/*
ClassDB::bind_method(D_METHOD("get_bone_path", "index"), &SpeciesModelData::get_bone_path);
ClassDB::bind_method(D_METHOD("set_bone_path", "index", "path"), &SpeciesModelData::set_bone_path);
ClassDB::bind_method(D_METHOD("get_visual", "index"), &SpeciesModelData::get_visual);
ClassDB::bind_method(D_METHOD("set_visual", "index", "entry"), &SpeciesModelData::set_visual);
ADD_GROUP("Visuals", "visual_");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_root", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_ROOT);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_pelvis", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_PELVIS);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_spine", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_SPINE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_spine_1", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_SPINE_1);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_spine_2", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_SPINE_2);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_neck", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_NECK);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_head", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_HEAD);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_clavicle", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_CLAVICLE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_upper_arm", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_UPPER_ARM);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_forearm", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_FOREARM);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_hand", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_HAND);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_thumb_base", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_THUMB_BASE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_thumb_end", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_THUMB_END);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_fingers_base", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_FINGERS_BASE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_fingers_end", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_FINGERS_END);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_clavicle", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_CLAVICLE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_upper_arm", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_UPPER_ARM);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_forearm", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_FOREARM);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_hand", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_HAND);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_thumb_base", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_THUMB_BASE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_thumb_end", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_THUMB_END);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_fingers_base", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_FINGERS_BASE);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_fingers_end", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_FINGERS_END);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_thigh", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_THIGH);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_calf", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_CALF);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_left_foot", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_LEFT_FOOT);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_thigh", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_THIGH);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_calf", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_CALF);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "visual_right_foot", PROPERTY_HINT_RESOURCE_TYPE, "CharacterSkeletonVisualEntry"), "set_visual", "get_visual", EntityEnums::SKELETON_POINT_RIGHT_FOOT);
ADD_GROUP("Bone Paths", "bone_path_");
ADD_PROPERTYI(PropertyInfo(Variant::NODE_PATH, "bone_path_root"), "set_bone_path", "get_bone_path", EntityEnums::SKELETON_POINT_ROOT);
ClassDB::bind_method(D_METHOD("get_bone_node", "bone_idx"), &SpeciesModelData::get_bone_node);
ClassDB::bind_method(D_METHOD("get_animation_player_path"), &SpeciesModelData::get_animation_player_path);
ClassDB::bind_method(D_METHOD("set_animation_player_path", "path"), &SpeciesModelData::set_animation_player_path);
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "animation_player_path"), "set_animation_player_path", "get_animation_player_path");
ClassDB::bind_method(D_METHOD("get_animation_tree_path"), &SpeciesModelData::get_animation_tree_path);
ClassDB::bind_method(D_METHOD("set_animation_tree_path", "path"), &SpeciesModelData::set_animation_tree_path);
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "animation_tree_path"), "set_animation_tree_path", "get_animation_tree_path");
ClassDB::bind_method(D_METHOD("get_animation_player"), &SpeciesModelData::get_animation_player);
ClassDB::bind_method(D_METHOD("get_animation_tree"), &SpeciesModelData::get_animation_tree);
ClassDB::bind_method(D_METHOD("update_nodes"), &SpeciesModelData::update_nodes);
*/
}

View File

@ -0,0 +1,47 @@
#ifndef SPECIES_MODEL_DATA_H
#define SPECIES_MODEL_DATA_H
#include "core/resource.h"
#include "core/vector.h"
#include "core/ustring.h"
#include "core/color.h"
#include "scene/resources/packed_scene.h"
#include "../data/item_visual_entry.h"
#include "../entity_enums.h"
class ItemVisual;
class SpeciesModelData : public Resource {
GDCLASS(SpeciesModelData, Resource);
public:
int get_id();
void set_id(int value);
String get_name();
void set_name(String value);
SpeciesModelData();
~SpeciesModelData();
protected:
static void _bind_methods();
private:
int _id;
String _name;
Vector<Ref<ItemVisualEntry> > _entries[EntityEnums::SKELETON_POINTS_MAX];
Vector<Color> _skin_colors;
Vector<Ref<ItemVisualEntry> > _hair_styles;
Vector<Color> _hair_colors;
Vector<Ref<ItemVisualEntry> > _heads;
Ref<PackedScene> _skeleton;
};
#endif