]> git.localhorst.tv Git - l2e.git/blob - src/battle/Resources.cpp
621f61ed745186bbf1a44bbb407167d00f61a666
[l2e.git] / src / battle / Resources.cpp
1 #include "Resources.h"
2
3 #include "../graphics/Animation.h"
4 #include "../graphics/Font.h"
5 #include "../graphics/Frame.h"
6 #include "../graphics/Gauge.h"
7 #include "../graphics/Menu.h"
8 #include "../graphics/Sprite.h"
9 #include "../loader/Interpreter.h"
10 #include "../loader/TypeDescription.h"
11
12 using graphics::Animation;
13 using graphics::Font;
14 using graphics::Frame;
15 using graphics::Gauge;
16 using graphics::MenuProperties;
17 using graphics::Sprite;
18 using loader::FieldDescription;
19 using loader::Interpreter;
20 using loader::TypeDescription;
21
22 namespace battle {
23
24 Resources::Resources()
25 : swapCursor(0)
26 , moveIcons(0)
27 , attackIcons(0)
28 , attackChoiceIcons(0)
29
30 , titleFrame(0)
31 , titleFont(0)
32
33 , heroTagFrame(0)
34 , activeHeroTagFrame(0)
35 , smallHeroTagFrame(0)
36 , lastSmallHeroTagFrame(0)
37
38 , heroTagFont(0)
39 , heroTagLabels(0)
40
41 , healthGauge(0)
42 , manaGauge(0)
43 , ikariGauge(0)
44
45 , selectFrame(0)
46
47 , normalFont(0)
48 , disabledFont(0)
49
50 , menuCursor(0)
51 , weaponTargetCursor(0)
52 , magicTargetCursor(0)
53 , itemTargetCursor(0)
54
55 , spellMenuHeadline("")
56 , spellMenuProperties(0)
57 , itemMenuHeadline("")
58 , itemMenuProperties(0)
59 , ikariMenuHeadline("")
60 , ikariMenuProperties(0)
61 , noEquipmentText("")
62
63 , escapeText("")
64
65 , numberAnimationPrototype(0)
66 , bigNumberSprite(0)
67 , greenNumberSprite(0)
68
69 , weaponMenuIcon(0)
70 , armorMenuIcon(0)
71 , shieldMenuIcon(0)
72 , helmetMenuIcon(0)
73 , ringMenuIcon(0)
74 , jewelMenuIcon(0)
75
76 , levelLabelCol(0)
77 , levelLabelRow(0)
78 , healthLabelCol(0)
79 , healthLabelRow(0)
80 , manaLabelCol(0)
81 , manaLabelRow(0)
82 , moveLabelCol(0)
83 , moveLabelRow(0)
84 , ikariLabelCol(0)
85 , ikariLabelRow(0)
86
87 , victoryGetsText(0)
88 , victoryExpText(0)
89 , victoryGoldText(0)
90 , victoryLevelUpText(0)
91 , victoryUpgradeText(0)
92 , victoryNextLevelText(0)
93
94 , victoryMHPText(0)
95 , victoryMMPText(0)
96 , victoryATPText(0)
97 , victoryDFPText(0)
98 , victorySTRText(0)
99 , victoryAGLText(0)
100 , victoryINTText(0)
101 , victoryGUTText(0)
102 , victoryMGRText(0)
103
104 { }
105
106
107 void Resources::CreateTypeDescription() {
108         Resources r;
109
110         TypeDescription &td(TypeDescription::Create(TYPE_ID, "BattleResources"));
111         td.SetConstructor(&Construct);
112         td.SetSize(sizeof(Resources));
113
114         td.AddField("swapCursor", FieldDescription(((char *)&r.swapCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the cursor sprite for swapping heroes"));
115         td.AddField("moveIcons", FieldDescription(((char *)&r.moveIcons) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the icons of the move selection menu"));
116         td.AddField("attackIcons", FieldDescription(((char *)&r.attackIcons) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the icons of the attack selection menu"));
117         td.AddField("attackChoiceIcons", FieldDescription(((char *)&r.attackChoiceIcons) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the icons showing the hero's attack choice in the respective tag"));
118
119         td.AddField("titleFrame", FieldDescription(((char *)&r.titleFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for title headings (spell names, status information, etc.)"));
120         td.AddField("titleFont", FieldDescription(((char *)&r.titleFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("the font for title headings"));
121
122         td.AddField("heroTagFrame", FieldDescription(((char *)&r.heroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for hero tags"));
123         td.AddField("activeHeroTagFrame", FieldDescription(((char *)&r.activeHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for the active hero's tag"));
124         td.AddField("smallHeroTagFrame", FieldDescription(((char *)&r.smallHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for small hero tags (during attack animation)"));
125         td.AddField("lastSmallHeroTagFrame", FieldDescription(((char *)&r.lastSmallHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for the last small hero tag"));
126
127         td.AddField("heroTagFont", FieldDescription(((char *)&r.heroTagFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for hero tags (hero names)"));
128         td.AddField("heroTagLabels", FieldDescription(((char *)&r.heroTagLabels) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("labels on the hero tag (hp/mp/ip/lvl/move)"));
129
130         td.AddField("healthGauge", FieldDescription(((char *)&r.healthGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("health gauge"));
131         td.AddField("manaGauge", FieldDescription(((char *)&r.manaGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("mana gauge"));
132         td.AddField("ikariGauge", FieldDescription(((char *)&r.ikariGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("ikari gauge"));
133
134         td.AddField("selectFrame", FieldDescription(((char *)&r.selectFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for spell, item, and ikari menus"));
135
136         td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for menus"));
137         td.AddField("disabledFont", FieldDescription(((char *)&r.disabledFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for disabled entries in menus"));
138
139         td.AddField("menuCursor", FieldDescription(((char *)&r.menuCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("selection indicator for menus"));
140         td.AddField("weaponTargetCursor", FieldDescription(((char *)&r.weaponTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong attack targets"));
141         td.AddField("magicTargetCursor", FieldDescription(((char *)&r.magicTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong spell targets"));
142         td.AddField("itemTargetCursor", FieldDescription(((char *)&r.itemTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong item targets"));
143
144         td.AddField("spellMenuHeadline", FieldDescription(((char *)&r.spellMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the spell menu"));
145         td.AddField("spellMenuProperties", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu"));
146
147         td.AddField("itemMenuHeadline", FieldDescription(((char *)&r.itemMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the item menu"));
148         td.AddField("itemMenuProperties", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the item menu"));
149
150         td.AddField("ikariMenuHeadline", FieldDescription(((char *)&r.ikariMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the ikari menu"));
151         td.AddField("ikariMenuProperties", FieldDescription(((char *)&r.ikariMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the ikari menu"));
152         td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("text to show for missing equipment"));
153
154         td.AddField("escapeText", FieldDescription(((char *)&r.escapeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("displayed when the party escapes"));
155
156         td.AddField("numberAnimationPrototype", FieldDescription(((char *)&r.numberAnimationPrototype) - ((char *)&r), Animation::TYPE_ID).SetReferenced().SetDescription("animation of an attack's result digit"));
157
158         td.AddField("bigNumberSprite", FieldDescription(((char *)&r.bigNumberSprite) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("sprite containing the damage numbers"));
159         td.AddField("greenNumberSprite", FieldDescription(((char *)&r.greenNumberSprite) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("sprite containing the healing numbers"));
160
161         td.AddField("weaponMenuIcon", FieldDescription(((char *)&r.weaponMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("weapon icon for ikari menu"));
162         td.AddField("armorMenuIcon", FieldDescription(((char *)&r.armorMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("armor icon for ikari menu"));
163         td.AddField("shieldMenuIcon", FieldDescription(((char *)&r.shieldMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("shield icon for ikari menu"));
164         td.AddField("helmetMenuIcon", FieldDescription(((char *)&r.helmetMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("helmet icon for ikari menu"));
165         td.AddField("ringMenuIcon", FieldDescription(((char *)&r.ringMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("ring icon for ikari menu"));
166         td.AddField("jewelMenuIcon", FieldDescription(((char *)&r.jewelMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("jewel icon for ikari menu"));
167
168         td.AddField("levelLabelRow", FieldDescription(((char *)&r.levelLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the level label in heroTagLabels"));
169         td.AddField("levelLabelCol", FieldDescription(((char *)&r.levelLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the level label in heroTagLabels"));
170         td.AddField("healthLabelRow", FieldDescription(((char *)&r.healthLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the health label in heroTagLabels"));
171         td.AddField("healthLabelCol", FieldDescription(((char *)&r.healthLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the health label in heroTagLabels"));
172         td.AddField("manaLabelRow", FieldDescription(((char *)&r.manaLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the mana label in heroTagLabels"));
173         td.AddField("manaLabelCol", FieldDescription(((char *)&r.manaLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the mana label in heroTagLabels"));
174         td.AddField("moveLabelRow", FieldDescription(((char *)&r.moveLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the move label in heroTagLabels"));
175         td.AddField("moveLabelCol", FieldDescription(((char *)&r.moveLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the move label in heroTagLabels"));
176         td.AddField("ikariLabelRow", FieldDescription(((char *)&r.ikariLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the ikari label in heroTagLabels"));
177         td.AddField("ikariLabelCol", FieldDescription(((char *)&r.ikariLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the ikari label in heroTagLabels"));
178
179         td.AddField("heroesBgColor", FieldDescription(((char *)&r.heroesBgColor) - ((char *)&r), Interpreter::COLOR_ID).SetDescription("background color of the small tags during attack animation"));
180
181         td.AddField("victoryGetsText", FieldDescription(((char *)&r.victoryGetsText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
182         td.AddField("victoryExpText", FieldDescription(((char *)&r.victoryExpText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
183         td.AddField("victoryGoldText", FieldDescription(((char *)&r.victoryGoldText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
184         td.AddField("victoryLevelUpText", FieldDescription(((char *)&r.victoryLevelUpText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
185         td.AddField("victoryUpgradeText", FieldDescription(((char *)&r.victoryUpgradeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
186         td.AddField("victoryNextLevelText", FieldDescription(((char *)&r.victoryNextLevelText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
187
188         td.AddField("victoryMHPText", FieldDescription(((char *)&r.victoryMHPText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
189         td.AddField("victoryMMPText", FieldDescription(((char *)&r.victoryMMPText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
190         td.AddField("victoryATPText", FieldDescription(((char *)&r.victoryATPText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
191         td.AddField("victoryDFPText", FieldDescription(((char *)&r.victoryDFPText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
192         td.AddField("victorySTRText", FieldDescription(((char *)&r.victorySTRText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
193         td.AddField("victoryAGLText", FieldDescription(((char *)&r.victoryAGLText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
194         td.AddField("victoryINTText", FieldDescription(((char *)&r.victoryINTText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
195         td.AddField("victoryGUTText", FieldDescription(((char *)&r.victoryGUTText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
196         td.AddField("victoryMGRText", FieldDescription(((char *)&r.victoryMGRText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
197 }
198
199 void Resources::Construct(void *data) {
200         new (data) Resources;
201 }
202
203 }