forked from kenygia/MooseEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemLabel.h
52 lines (45 loc) · 1.15 KB
/
ItemLabel.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
#ifndef ITEMLABEL_H
#define ITEMLABEL_H
#include <QLabel>
#include <QTextEdit>
#include <vector>
#include "TooltipFrame.h"
#include "GameItem.h"
#include "GenStatsReader.h"
class ItemLabel : public QLabel
{
Q_OBJECT
public:
explicit ItemLabel(std::vector<StatsContainer *>& allItemStats, QWidget *parent = 0, QWidget *mainWindow = 0);
GameItem *getItem() {
return this->item;
}
void setItem(GameItem *item) {
this->item = item;
}
~ItemLabel() {
if (tooltip != 0) {
tooltip->hide();
delete tooltip;
}
}
protected:
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
private:
bool ignoreEnterEvent = false;
TooltipFrame *tooltip = 0;
GameItem *item = 0;
void setupTooltip();
std::vector<StatsContainer *>& allItemStats;
double calculateDamage(long damageStat, long itemLevel, long damageBoost);
long getSummedStat(std::string statName);
void displayItemStats(std::ostringstream &contentHtml);
long getItemStatValue(std::string statName);
long getModStatValue(std::string statName);
long getSummedItemStat(std::string statName);
long getPermBoostStatValue(std::string statName);
signals:
public slots:
};
#endif // ITEMLABEL_H