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