diff --git a/SCsub b/SCsub index b73542f..c040b8e 100644 --- a/SCsub +++ b/SCsub @@ -94,6 +94,7 @@ module_env.add_source_files(env.modules_sources,"skeleton/character_skeleton_3d. 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,"skeleton/skeleton_model_entry.cpp") module_env.add_source_files(env.modules_sources,"utility/entity_create_info.cpp") diff --git a/register_types.cpp b/register_types.cpp index 6ca22b8..cfba0aa 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -79,6 +79,7 @@ #include "skeleton/species_model_data.h" #include "skeleton/entity_species_data.h" +#include "skeleton/skeleton_model_entry.h" #include "utility/entity_create_info.h" #include "utility/cooldown.h" @@ -217,6 +218,7 @@ void register_entity_spell_system_types() { ClassDB::register_class(); ClassDB::register_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); diff --git a/skeleton/skeleton_model_entry.cpp b/skeleton/skeleton_model_entry.cpp new file mode 100644 index 0000000..bdf197d --- /dev/null +++ b/skeleton/skeleton_model_entry.cpp @@ -0,0 +1,46 @@ +#include "skeleton_model_entry.h" + +int SkeletonModelEntry::get_priority() { + return _priority; +} +void SkeletonModelEntry::set_priority(int value) { + _priority = value; +} + +Color SkeletonModelEntry::get_color() { + return _color; +} +void SkeletonModelEntry::set_color(Color value) { + _color = value; +} + +Ref SkeletonModelEntry::get_entry() { + return _entry; +} +void SkeletonModelEntry::set_entry(Ref entry) { + _entry = entry; +} + +SkeletonModelEntry::SkeletonModelEntry() { + _priority = 0; + _color = Color(1, 1, 1, 1); +} + +SkeletonModelEntry::~SkeletonModelEntry() { + _entry.unref(); +} + +void SkeletonModelEntry::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_priority"), &SkeletonModelEntry::get_priority); + ClassDB::bind_method(D_METHOD("set_priority", "value"), &SkeletonModelEntry::set_priority); + ADD_PROPERTY(PropertyInfo(Variant::INT, "priority"), "set_priority", "get_priority"); + + ClassDB::bind_method(D_METHOD("get_color"), &SkeletonModelEntry::get_color); + ClassDB::bind_method(D_METHOD("set_color", "value"), &SkeletonModelEntry::set_color); + ADD_PROPERTY(PropertyInfo(Variant::INT, "color"), "set_color", "get_color"); + + ClassDB::bind_method(D_METHOD("get_entry"), &SkeletonModelEntry::get_entry); + ClassDB::bind_method(D_METHOD("set_entry", "path"), &SkeletonModelEntry::set_entry); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "entry", PROPERTY_HINT_RESOURCE_TYPE, "ItemVisualEntry"), "set_entry", "get_entry"); +} + diff --git a/skeleton/skeleton_model_entry.h b/skeleton/skeleton_model_entry.h new file mode 100644 index 0000000..69a91fa --- /dev/null +++ b/skeleton/skeleton_model_entry.h @@ -0,0 +1,32 @@ +#ifndef SKELETON_MODEL_ENTRY_H +#define SKELETON_MODEL_ENTRY_H + +#include "core/reference.h" +#include "../data/item_visual_entry.h" + +class SkeletonModelEntry : public Reference { + GDCLASS(SkeletonModelEntry, Reference); + +public: + int get_priority(); + void set_priority(int value); + + Color get_color(); + void set_color(Color value); + + Ref get_entry(); + void set_entry(Ref entry); + + SkeletonModelEntry(); + ~SkeletonModelEntry(); + +protected: + static void _bind_methods(); + +private: + int _priority; + Color _color; + Ref _entry; +}; + +#endif