forked from kenygia/MooseEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EquipmentHandler.h
72 lines (63 loc) · 2.31 KB
/
EquipmentHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef EQUIPMENTHANDLER_H
#define EQUIPMENTHANDLER_H
#include "InventoryHandler.h"
#include "ItemEditFrame.h"
#include "GameItem.h"
#include "GameCharacter.h"
#include "TextureAtlas.h"
#include <string>
#include <vector>
#define EQUIP_SLOTS 12
#define SLOT_HELMET 0
#define SLOT_BREAST 1
#define SLOT_GARMENT 2
#define SLOT_WEAPON 3
#define SLOT_SHIELD 4
#define SLOT_RING_LEFT 5
#define SLOT_BELT 6
#define SLOT_BOOTS 7
#define SLOT_BRACERS 8
#define SLOT_AMULET 9
#define SLOT_RING_RIGHT 11
class EquipmentHandler : public QObject, public ItemEditCallback, ItemEditorCloseCallback
{
Q_OBJECT
private:
InventoryHandler *equipHandler[EQUIP_SLOTS];
QImage emptySlotImage;
std::vector<LsbObject *> &stats;
std::vector<LsbObject *> &rootTemplates;
std::vector<LsbObject *> &modTemplates;
TextureAtlas &iconAtlas;
TextureAtlas &abilityAtlas;
std::vector<StatsContainer *> &itemStats;
std::map<std::string, std::string> &nameMappings;
std::vector<StatsContainer *>& itemLinks;
std::vector<TAG_LSB *>& tagList;
std::map<std::string, LsbObject *> &rootTemplateMap;
std::map<std::string, LsbObject *> &modTemplateMap;
std::vector<short> &randTable;
void initInventoryHandlers();
QWidget *parentWidget;
QWidget *mainWindow;
LsbObject *itemsObject;
GameCharacter *character;
StatTemplateMap &statToTemplateMap;
public slots:
void customContextRequested(const QPoint& pos);
public:
~EquipmentHandler();
EquipmentHandler(QImage emptySlotImage, std::vector<LsbObject *>& stats, std::vector<LsbObject *>& rootTemplates,
std::vector<LsbObject *>& modTemplates, TextureAtlas& iconAtlas, TextureAtlas& abilityAtlas, std::vector<StatsContainer *>& itemStats,
std::map<std::string, std::string>& nameMappings, QWidget *parentWidget, QWidget *mainWindow, std::vector<StatsContainer *>& itemLinks,
std::vector<TAG_LSB *>& tagList, LsbObject *itemsObject, GameCharacter *character,
std::map<std::string, LsbObject *> &rootTemplateMap, std::map<std::string, LsbObject *> &modTemplateMap, StatTemplateMap &statToTemplateMap, std::vector<short> &randTable);
void addItem(GameItem *item);
void drawAll();
void onItemEdited(GameItem *newItem, GameItem *oldItem);
GameItem *getItemAtSlot(unsigned short slot);
void onClose(ItemEditFrame *itemEditFrame) {
delete itemEditFrame;
}
};
#endif // EQUIPMENTHANDLER_H