]> git.localhorst.tv Git - l2e.git/blob - src/battle/Resources.cpp
d50571f10bb3fd1c20686b3174ac61ff49b0d0ef
[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 { }
88
89
90 void Resources::CreateTypeDescription() {
91         Resources r;
92
93         TypeDescription &td(TypeDescription::Create(TYPE_ID, "BattleResources"));
94         td.SetConstructor(&Construct);
95         td.SetSize(sizeof(Resources));
96
97         td.AddField("swapCursor", FieldDescription(((char *)&r.swapCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the cursor sprite for swapping heroes"));
98         td.AddField("moveIcons", FieldDescription(((char *)&r.moveIcons) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the icons of the move selection menu"));
99         td.AddField("attackIcons", FieldDescription(((char *)&r.attackIcons) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("the icons of the attack selection menu"));
100         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"));
101
102         td.AddField("titleFrame", FieldDescription(((char *)&r.titleFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for title headings (spell names, status information, etc.)"));
103         td.AddField("titleFont", FieldDescription(((char *)&r.titleFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("the font for title headings"));
104
105         td.AddField("heroTagFrame", FieldDescription(((char *)&r.heroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for hero tags"));
106         td.AddField("activeHeroTagFrame", FieldDescription(((char *)&r.activeHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for the active hero's tag"));
107         td.AddField("smallHeroTagFrame", FieldDescription(((char *)&r.smallHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for small hero tags (during attack animation)"));
108         td.AddField("lastSmallHeroTagFrame", FieldDescription(((char *)&r.lastSmallHeroTagFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for the last small hero tag"));
109
110         td.AddField("heroTagFont", FieldDescription(((char *)&r.heroTagFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for hero tags (hero names)"));
111         td.AddField("heroTagLabels", FieldDescription(((char *)&r.heroTagLabels) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("labels on the hero tag (hp/mp/ip/lvl/move)"));
112
113         td.AddField("healthGauge", FieldDescription(((char *)&r.healthGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("health gauge"));
114         td.AddField("manaGauge", FieldDescription(((char *)&r.manaGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("mana gauge"));
115         td.AddField("ikariGauge", FieldDescription(((char *)&r.ikariGauge) - ((char *)&r), Gauge::TYPE_ID).SetReferenced().SetDescription("ikari gauge"));
116
117         td.AddField("selectFrame", FieldDescription(((char *)&r.selectFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for spell, item, and ikari menus"));
118
119         td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for menus"));
120         td.AddField("disabledFont", FieldDescription(((char *)&r.disabledFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("font for disabled entries in menus"));
121
122         td.AddField("menuCursor", FieldDescription(((char *)&r.menuCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("selection indicator for menus"));
123         td.AddField("weaponTargetCursor", FieldDescription(((char *)&r.weaponTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong attack targets"));
124         td.AddField("magicTargetCursor", FieldDescription(((char *)&r.magicTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong spell targets"));
125         td.AddField("itemTargetCursor", FieldDescription(((char *)&r.itemTargetCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selectiong item targets"));
126
127         td.AddField("spellMenuHeadline", FieldDescription(((char *)&r.spellMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the spell menu"));
128         td.AddField("spellMenuProperties", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu"));
129
130         td.AddField("itemMenuHeadline", FieldDescription(((char *)&r.itemMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the item menu"));
131         td.AddField("itemMenuProperties", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the item menu"));
132
133         td.AddField("ikariMenuHeadline", FieldDescription(((char *)&r.ikariMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("headline of the ikari menu"));
134         td.AddField("ikariMenuProperties", FieldDescription(((char *)&r.ikariMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the ikari menu"));
135         td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("text to show for missing equipment"));
136
137         td.AddField("escapeText", FieldDescription(((char *)&r.escapeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced().SetDescription("displayed when the party escapes"));
138
139         td.AddField("numberAnimationPrototype", FieldDescription(((char *)&r.numberAnimationPrototype) - ((char *)&r), Animation::TYPE_ID).SetReferenced().SetDescription("animation of an attack's result digit"));
140
141         td.AddField("bigNumberSprite", FieldDescription(((char *)&r.bigNumberSprite) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("sprite containing the damage numbers"));
142         td.AddField("greenNumberSprite", FieldDescription(((char *)&r.greenNumberSprite) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("sprite containing the healing numbers"));
143
144         td.AddField("weaponMenuIcon", FieldDescription(((char *)&r.weaponMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("weapon icon for ikari menu"));
145         td.AddField("armorMenuIcon", FieldDescription(((char *)&r.armorMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("armor icon for ikari menu"));
146         td.AddField("shieldMenuIcon", FieldDescription(((char *)&r.shieldMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("shield icon for ikari menu"));
147         td.AddField("helmetMenuIcon", FieldDescription(((char *)&r.helmetMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("helmet icon for ikari menu"));
148         td.AddField("ringMenuIcon", FieldDescription(((char *)&r.ringMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("ring icon for ikari menu"));
149         td.AddField("jewelMenuIcon", FieldDescription(((char *)&r.jewelMenuIcon) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("jewel icon for ikari menu"));
150
151         td.AddField("levelLabelRow", FieldDescription(((char *)&r.levelLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the level label in heroTagLabels"));
152         td.AddField("levelLabelCol", FieldDescription(((char *)&r.levelLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the level label in heroTagLabels"));
153         td.AddField("healthLabelRow", FieldDescription(((char *)&r.healthLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the health label in heroTagLabels"));
154         td.AddField("healthLabelCol", FieldDescription(((char *)&r.healthLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the health label in heroTagLabels"));
155         td.AddField("manaLabelRow", FieldDescription(((char *)&r.manaLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the mana label in heroTagLabels"));
156         td.AddField("manaLabelCol", FieldDescription(((char *)&r.manaLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the mana label in heroTagLabels"));
157         td.AddField("moveLabelRow", FieldDescription(((char *)&r.moveLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the move label in heroTagLabels"));
158         td.AddField("moveLabelCol", FieldDescription(((char *)&r.moveLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the move label in heroTagLabels"));
159         td.AddField("ikariLabelRow", FieldDescription(((char *)&r.ikariLabelRow) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("column of the ikari label in heroTagLabels"));
160         td.AddField("ikariLabelCol", FieldDescription(((char *)&r.ikariLabelCol) - ((char *)&r), Interpreter::NUMBER_ID).SetDescription("row of the ikari label in heroTagLabels"));
161
162         td.AddField("heroesBgColor", FieldDescription(((char *)&r.heroesBgColor) - ((char *)&r), Interpreter::COLOR_ID).SetDescription("background color of the small tags during attack animation"));
163 }
164
165 void Resources::Construct(void *data) {
166         new (data) Resources;
167 }
168
169 }