mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-04-19 21:33:15 +02:00
Added a simple itemVisual class, and an ItemVisualEntry Class.
This commit is contained in:
parent
378fc4642f
commit
9267eb3fd9
3
SCsub
3
SCsub
@ -25,6 +25,9 @@ module_env.add_source_files(env.modules_sources,"data/item_instance.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"data/item_template.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"data/spell_cooldown_manipulation_data.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"data/item_visual.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"data/item_visual_entry.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"data/craft_data_attribute_helper.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"data/craft_data_attribute.cpp")
|
||||
|
||||
|
@ -53,6 +53,13 @@ void ItemTemplate::set_rarity(const ItemEnums::ItemRarity value) {
|
||||
_rarity = value;
|
||||
}
|
||||
|
||||
Ref<ItemVisual> ItemTemplate::get_item_visual() const {
|
||||
return _item_visual;
|
||||
}
|
||||
void ItemTemplate::set_item_visual(const Ref<ItemVisual> value) {
|
||||
_item_visual = value;
|
||||
}
|
||||
|
||||
int ItemTemplate::get_inventory_size_x() const {
|
||||
return _inventory_size_x;
|
||||
}
|
||||
@ -324,6 +331,10 @@ void ItemTemplate::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_rarity", "count"), &ItemTemplate::set_rarity);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "rarity", PROPERTY_HINT_ENUM, ItemEnums::BINDING_STRING_RARITY), "set_rarity", "get_rarity");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_visual"), &ItemTemplate::get_item_visual);
|
||||
ClassDB::bind_method(D_METHOD("set_item_visual", "value"), &ItemTemplate::set_item_visual);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "item_visual", PROPERTY_HINT_RESOURCE_TYPE, "ItemVisual"), "set_item_visual", "get_item_visual");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_inventory_size_x"), &ItemTemplate::get_inventory_size_x);
|
||||
ClassDB::bind_method(D_METHOD("set_inventory_size_x", "value"), &ItemTemplate::set_inventory_size_x);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "inventory_size_x"), "set_inventory_size_x", "get_inventory_size_x");
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "core/resource.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
#include "item_visual.h"
|
||||
#include "item_template_stat_modifier.h"
|
||||
#include "../entities/stats/stat.h"
|
||||
#include "../item_enums.h"
|
||||
@ -36,6 +37,9 @@ public:
|
||||
ItemEnums::ItemRarity get_rarity() const;
|
||||
void set_rarity(const ItemEnums::ItemRarity value);
|
||||
|
||||
Ref<ItemVisual> get_item_visual() const;
|
||||
void set_item_visual(const Ref<ItemVisual> value);
|
||||
|
||||
int get_inventory_size_x() const;
|
||||
void set_inventory_size_x(const int value);
|
||||
|
||||
@ -63,7 +67,6 @@ public:
|
||||
Ref<Aura> get_aura(int index) const;
|
||||
void set_aura(const int index, const Ref<Aura> aura);
|
||||
|
||||
|
||||
int get_item_stat_modifier_count() const;
|
||||
void set_item_stat_modifier_count(const int value);
|
||||
|
||||
@ -112,6 +115,8 @@ private:
|
||||
ItemEnums::ItemSubtype _item_sub_type;
|
||||
ItemEnums::ItemSubSubtype _item_sub_sub_type;
|
||||
|
||||
Ref<ItemVisual> _item_visual;
|
||||
|
||||
int _inventory_size_x;
|
||||
int _inventory_size_y;
|
||||
|
||||
|
10
data/item_visual.cpp
Normal file
10
data/item_visual.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "item_visual.h"
|
||||
|
||||
ItemVisual::ItemVisual() {
|
||||
}
|
||||
|
||||
ItemVisual::~ItemVisual() {
|
||||
}
|
||||
|
||||
void ItemVisual::_bind_methods() {
|
||||
}
|
19
data/item_visual.h
Normal file
19
data/item_visual.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef ITEM_VISUAL_H
|
||||
#define ITEM_VISUAL_H
|
||||
|
||||
#include "core/reference.h"
|
||||
|
||||
class ItemVisual : public Reference {
|
||||
GDCLASS(ItemVisual, Reference);
|
||||
|
||||
public:
|
||||
ItemVisual();
|
||||
~ItemVisual();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
};
|
||||
|
||||
#endif
|
11
data/item_visual_entry.cpp
Normal file
11
data/item_visual_entry.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "item_visual_entry.h"
|
||||
|
||||
|
||||
ItemVisualEntry::ItemVisualEntry() {
|
||||
}
|
||||
|
||||
ItemVisualEntry::~ItemVisualEntry() {
|
||||
}
|
||||
|
||||
void ItemVisualEntry::_bind_methods() {
|
||||
}
|
19
data/item_visual_entry.h
Normal file
19
data/item_visual_entry.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef ITEM_VISUAL_ENTRY_H
|
||||
#define ITEM_VISUAL_ENTRY_H
|
||||
|
||||
#include "core/reference.h"
|
||||
|
||||
class ItemVisualEntry : public Reference {
|
||||
GDCLASS(ItemVisualEntry, Reference);
|
||||
|
||||
public:
|
||||
ItemVisualEntry();
|
||||
~ItemVisualEntry();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//private:
|
||||
};
|
||||
|
||||
#endif
|
@ -15,6 +15,9 @@
|
||||
#include "data/item_template_stat_modifier.h"
|
||||
#include "data/spell_cooldown_manipulation_data.h"
|
||||
|
||||
#include "data/item_visual.h"
|
||||
#include "data/item_visual_entry.h"
|
||||
|
||||
#include "data/item_template.h"
|
||||
#include "data/item_instance.h"
|
||||
|
||||
@ -100,6 +103,9 @@ void register_entity_spell_system_types() {
|
||||
|
||||
ClassDB::register_class<DataManager>();
|
||||
|
||||
ClassDB::register_class<ItemVisual>();
|
||||
ClassDB::register_class<ItemVisualEntry>();
|
||||
|
||||
//entity data
|
||||
ClassDB::register_class<EntityEnums>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user