1 |
|
|
/* |
2 |
|
|
* The ManaPlus Client |
3 |
|
|
* Copyright (C) 2004-2009 The Mana World Development Team |
4 |
|
|
* Copyright (C) 2009-2010 The Mana Developers |
5 |
|
|
* Copyright (C) 2011-2019 The ManaPlus Developers |
6 |
|
|
* Copyright (C) 2019-2021 Andrei Karas |
7 |
|
|
* |
8 |
|
|
* This file is part of The ManaPlus Client. |
9 |
|
|
* |
10 |
|
|
* This program is free software; you can redistribute it and/or modify |
11 |
|
|
* it under the terms of the GNU General Public License as published by |
12 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
13 |
|
|
* any later version. |
14 |
|
|
* |
15 |
|
|
* This program is distributed in the hope that it will be useful, |
16 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
|
|
* GNU General Public License for more details. |
19 |
|
|
* |
20 |
|
|
* You should have received a copy of the GNU General Public License |
21 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 |
|
|
*/ |
23 |
|
|
|
24 |
|
|
#ifndef GUI_WIDGETS_SKILLINFO_H |
25 |
|
|
#define GUI_WIDGETS_SKILLINFO_H |
26 |
|
|
|
27 |
|
|
#include "enums/simpletypes/modifiable.h" |
28 |
|
|
#include "enums/simpletypes/visible.h" |
29 |
|
|
|
30 |
|
|
#include "enums/resources/skill/casttype.h" |
31 |
|
|
#include "enums/resources/skill/skillowner.h" |
32 |
|
|
#include "enums/resources/skill/skilltype.h" |
33 |
|
|
|
34 |
|
|
#include "utils/vector.h" |
35 |
|
|
|
36 |
|
|
#include <string> |
37 |
|
|
#include <map> |
38 |
|
|
|
39 |
|
|
#include "localconsts.h" |
40 |
|
|
|
41 |
|
|
struct SkillData; |
42 |
|
|
|
43 |
|
|
class SkillModel; |
44 |
|
|
class SkillTab; |
45 |
|
|
|
46 |
|
|
typedef std::map<int, SkillData*> SkillDataMap; |
47 |
|
|
typedef SkillDataMap::iterator SkillDataMapIter; |
48 |
|
|
typedef SkillDataMap::const_iterator SkillDataMapCIter; |
49 |
|
|
|
50 |
|
|
struct SkillInfo final |
51 |
|
|
{ |
52 |
|
|
std::string skillLevel; |
53 |
|
|
std::string skillEffect; |
54 |
|
|
std::string useButton; |
55 |
|
|
std::string errorText; |
56 |
|
|
std::string castingAction; |
57 |
|
|
std::string castingRideAction; |
58 |
|
|
std::string castingSkyAction; |
59 |
|
|
std::string castingWaterAction; |
60 |
|
|
SkillDataMap dataMap; |
61 |
|
|
SkillModel *model; |
62 |
|
|
SkillTab *tab; |
63 |
|
|
SkillData *data; |
64 |
|
|
int level; |
65 |
|
|
int customSelectedLevel; |
66 |
|
|
int customOffsetX; |
67 |
|
|
int customOffsetY; |
68 |
|
|
int skillLevelWidth; |
69 |
|
|
unsigned int id; |
70 |
|
|
int range; |
71 |
|
|
int sp; |
72 |
|
|
int duration; |
73 |
|
|
int durationTime; |
74 |
|
|
int cooldown; |
75 |
|
|
int x; |
76 |
|
|
int y; |
77 |
|
|
SkillType::SkillType type; |
78 |
|
|
SkillOwner::Type owner; |
79 |
|
|
CastTypeT customCastType; |
80 |
|
|
Modifiable modifiable; |
81 |
|
|
Visible visible; |
82 |
|
|
Visible alwaysVisible; |
83 |
|
|
bool useTextParameter; |
84 |
|
|
|
85 |
|
|
SkillInfo(); |
86 |
|
|
A_DELETE_COPY(SkillInfo) |
87 |
|
|
~SkillInfo(); |
88 |
|
|
|
89 |
|
|
void update(); |
90 |
|
|
|
91 |
|
|
SkillData *getData(const int level) const A_WARN_UNUSED; |
92 |
|
|
SkillData *getData1(const int level) const A_WARN_UNUSED; |
93 |
|
|
|
94 |
|
|
void addData(const int level, SkillData *const data); |
95 |
|
|
|
96 |
|
|
bool isUsable() const noexcept2 A_WARN_UNUSED |
97 |
|
|
{ |
98 |
|
|
return type == SkillType::Attack |
99 |
|
|
|| type == SkillType::Self |
100 |
|
|
|| type == SkillType::Support; |
101 |
|
|
} |
102 |
|
|
|
103 |
|
|
std::string toDataStr() const A_WARN_UNUSED; |
104 |
|
|
}; |
105 |
|
|
|
106 |
|
|
typedef STD_VECTOR<SkillInfo*> SkillList; |
107 |
|
|
typedef SkillList::iterator SkillListIter; |
108 |
|
|
|
109 |
|
|
#endif // GUI_WIDGETS_SKILLINFO_H |