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