mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-05-09 22:41:39 +02:00
Added SkeletonModelEntry.
This commit is contained in:
parent
65ab6c1dbd
commit
de25ec9dd5
1
SCsub
1
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")
|
||||
|
||||
|
@ -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<EntitySpeciesData>();
|
||||
ClassDB::register_class<SpeciesModelData>();
|
||||
ClassDB::register_class<SkeletonModelEntry>();
|
||||
|
||||
ClassDB::register_class<Cooldown>();
|
||||
ClassDB::register_class<CategoryCooldown>();
|
||||
|
46
skeleton/skeleton_model_entry.cpp
Normal file
46
skeleton/skeleton_model_entry.cpp
Normal file
@ -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<ItemVisualEntry> SkeletonModelEntry::get_entry() {
|
||||
return _entry;
|
||||
}
|
||||
void SkeletonModelEntry::set_entry(Ref<ItemVisualEntry> 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");
|
||||
}
|
||||
|
32
skeleton/skeleton_model_entry.h
Normal file
32
skeleton/skeleton_model_entry.h
Normal file
@ -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<ItemVisualEntry> get_entry();
|
||||
void set_entry(Ref<ItemVisualEntry> entry);
|
||||
|
||||
SkeletonModelEntry();
|
||||
~SkeletonModelEntry();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
int _priority;
|
||||
Color _color;
|
||||
Ref<ItemVisualEntry> _entry;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user