]> git.localhorst.tv Git - l2e.git/blob - src/menu/Resources.cpp
9b725d04149fffb86160fbf43628b71070f2a1fb
[l2e.git] / src / menu / Resources.cpp
1 #include "Resources.h"
2
3 #include "../graphics/Font.h"
4 #include "../graphics/Frame.h"
5 #include "../graphics/Menu.h"
6 #include "../graphics/Sprite.h"
7 #include "../graphics/Texture.h"
8 #include "../loader/Interpreter.h"
9 #include "../loader/TypeDescription.h"
10
11 using graphics::Font;
12 using graphics::Frame;
13 using graphics::MenuProperties;
14 using graphics::Sprite;
15 using graphics::Texture;
16 using loader::FieldDescription;
17 using loader::Interpreter;
18 using loader::TypeDescription;
19
20 namespace menu {
21
22 Resources::Resources()
23 : menubg(0)
24 , normalFont(0)
25 , inactiveFont(0)
26 , statusFont(0)
27
28 , statusLabels(0)
29 , statusFrame(0)
30
31 , mainMenuProperties(0)
32 , mainMenuItemText(0)
33 , mainMenuSpellText(0)
34 , mainMenuCapsuleText(0)
35 , mainMenuEquipmentText(0)
36 , mainMenuStatusText(0)
37 , mainMenuChangeText(0)
38 , mainMenuConfigText(0)
39 , mainMenuScenarioText(0)
40
41 , mainMenuTimeText(0)
42 , mainMenuGoldText(0)
43
44 , heroCursor(0)
45 , heroCursorBlinkTime(0)
46
47 , noEquipmentText(0)
48
49 , shoulderNav(0)
50
51 , atpLabel(0)
52 , dfpLabel(0)
53 , strLabel(0)
54 , aglLabel(0)
55 , intLabel(0)
56 , gutLabel(0)
57 , mgrLabel(0)
58
59 , ipLabel(0)
60 , experienceLabel(0)
61 , nextLevelLabel(0)
62
63 , statusMenuProperties(0)
64
65 , nextLabel(0)
66 , returnLabel(0)
67
68 , itemMenuProperties(0)
69 , itemMenuUseText(0)
70 , itemMenuSortText(0)
71 , itemMenuDropText(0)
72
73 , inventoryMenuProperties(0)
74
75 , spellMenuProperties(0)
76
77 , equipmentActionMenuProperties(0)
78 , equipmentMenuProperties(0)
79 , equipMenuEquipLabel(0)
80 , equipMenuStrongestLabel(0)
81 , equipMenuRemoveLabel(0)
82 , equipMenuRemoveAllLabel(0)
83 , equipMenuDropLabel(0)
84
85 , configMenuProperties(0)
86 , configMessageSpeedLabel(0)
87 , configMessageSpeedFast(0)
88 , configMessageSpeedNormal(0)
89 , configMessageSpeedSlow(0)
90 , configBattleCursorLabel(0)
91 , configStatusCursorLabel(0)
92 , configCursorClear(0)
93 , configCursorMemory(0)
94 , configMusicLabel(0)
95 , configMusicStereo(0)
96 , configMusicMono(0)
97
98 , scenarioMenuProperties(0)
99 , scenarioMenuHeadline(0)
100
101 , capsulebg(0)
102
103 , capsuleMenuProperties(0)
104
105 , capsuleFeedLabel(0)
106 , capsuleChangeLabel(0)
107 , capsuleNameLabel(0)
108 , capsuleClassLabel(0)
109 , capsuleAlignmentLabel(0)
110 , capsuleTribeLabel(0)
111 , capsuleAttack1Label(0)
112 , capsuleAttack2Label(0)
113 , capsuleAttack3Label(0)
114
115 { }
116
117
118 void Resources::CreateTypeDescription() {
119         Resources r;
120
121         TypeDescription &td(TypeDescription::Create(TYPE_ID, "MenuResources"));
122         td.SetConstructor(&Construct);
123         td.SetSize(sizeof(Resources));
124
125         td.AddField("menubg", FieldDescription(((char *)&r.menubg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for menus"));
126
127         td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("normal menu font"));
128         td.AddField("inactiveFont", FieldDescription(((char *)&r.inactiveFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("inactive menu font"));
129         td.AddField("statusFont", FieldDescription(((char *)&r.statusFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("status font"));
130
131         td.AddField("statusLabels", FieldDescription(((char *)&r.statusLabels) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("labels for the hero status"));
132         td.AddField("statusFrame", FieldDescription(((char *)&r.statusFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for almost every menu"));
133
134         td.AddField("mainMenu", FieldDescription(((char *)&r.mainMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the main menu"));
135         td.AddField("mainMenuItemText", FieldDescription(((char *)&r.mainMenuItemText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
136         td.AddField("mainMenuSpellText", FieldDescription(((char *)&r.mainMenuSpellText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
137         td.AddField("mainMenuCapsuleText", FieldDescription(((char *)&r.mainMenuCapsuleText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
138         td.AddField("mainMenuEquipmentText", FieldDescription(((char *)&r.mainMenuEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
139         td.AddField("mainMenuStatusText", FieldDescription(((char *)&r.mainMenuStatusText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
140         td.AddField("mainMenuChangeText", FieldDescription(((char *)&r.mainMenuChangeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
141         td.AddField("mainMenuConfigText", FieldDescription(((char *)&r.mainMenuConfigText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
142         td.AddField("mainMenuScenarioText", FieldDescription(((char *)&r.mainMenuScenarioText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
143
144         td.AddField("mainMenuTimeText", FieldDescription(((char *)&r.mainMenuTimeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
145         td.AddField("mainMenuGoldText", FieldDescription(((char *)&r.mainMenuGoldText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
146
147         td.AddField("heroCursor", FieldDescription(((char *)&r.heroCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selecting a hero"));
148         td.AddField("heroCursorBlinkTime", FieldDescription(((char *)&r.heroCursorBlinkTime) - ((char *)&r), Interpreter::NUMBER_ID).SetReferenced().SetDescription("blinking interval (half) for the hero cursor"));
149
150         td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
151
152         td.AddField("shoulderNav", FieldDescription(((char *)&r.shoulderNav) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("visual aid for the hero navigation via shoulder buttons in some sub menus"));
153
154         td.AddField("atpLabel", FieldDescription(((char *)&r.atpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
155         td.AddField("dfpLabel", FieldDescription(((char *)&r.dfpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
156         td.AddField("strLabel", FieldDescription(((char *)&r.strLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
157         td.AddField("aglLabel", FieldDescription(((char *)&r.aglLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
158         td.AddField("intLabel", FieldDescription(((char *)&r.intLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
159         td.AddField("gutLabel", FieldDescription(((char *)&r.gutLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
160         td.AddField("mgrLabel", FieldDescription(((char *)&r.mgrLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
161
162         td.AddField("ipLabel", FieldDescription(((char *)&r.ipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
163         td.AddField("experienceLabel", FieldDescription(((char *)&r.experienceLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
164         td.AddField("nextLevelLabel", FieldDescription(((char *)&r.nextLevelLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
165
166         td.AddField("statusMenu", FieldDescription(((char *)&r.statusMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the status menu"));
167
168         td.AddField("nextLabel", FieldDescription(((char *)&r.nextLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
169         td.AddField("returnLabel", FieldDescription(((char *)&r.returnLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
170
171         td.AddField("itemMenu", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the item menu"));
172         td.AddField("itemMenuUseText", FieldDescription(((char *)&r.itemMenuUseText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
173         td.AddField("itemMenuSortText", FieldDescription(((char *)&r.itemMenuSortText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
174         td.AddField("itemMenuDropText", FieldDescription(((char *)&r.itemMenuDropText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
175
176         td.AddField("inventoryMenu", FieldDescription(((char *)&r.inventoryMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the inventory menu"));
177         td.AddField("spellMenu", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu"));
178
179         td.AddField("equipmentActionMenu", FieldDescription(((char *)&r.equipmentActionMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the equipment action menu (the lower one)"));
180         td.AddField("equipmentMenu", FieldDescription(((char *)&r.equipmentMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the equipment menu (the one with the equipped items)"));
181         td.AddField("equipMenuEquipLabel", FieldDescription(((char *)&r.equipMenuEquipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
182         td.AddField("equipMenuStrongestLabel", FieldDescription(((char *)&r.equipMenuStrongestLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
183         td.AddField("equipMenuRemoveLabel", FieldDescription(((char *)&r.equipMenuRemoveLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
184         td.AddField("equipMenuRemoveAllLabel", FieldDescription(((char *)&r.equipMenuRemoveAllLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
185         td.AddField("equipMenuDropLabel", FieldDescription(((char *)&r.equipMenuDropLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
186
187         td.AddField("configMenu", FieldDescription(((char *)&r.configMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the configuration menu"));
188         td.AddField("configMessageSpeedLabel", FieldDescription(((char *)&r.configMessageSpeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
189         td.AddField("configMessageSpeedFast", FieldDescription(((char *)&r.configMessageSpeedFast) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
190         td.AddField("configMessageSpeedNormal", FieldDescription(((char *)&r.configMessageSpeedNormal) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
191         td.AddField("configMessageSpeedSlow", FieldDescription(((char *)&r.configMessageSpeedSlow) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
192         td.AddField("configBattleCursorLabel", FieldDescription(((char *)&r.configBattleCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
193         td.AddField("configStatusCursorLabel", FieldDescription(((char *)&r.configStatusCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
194         td.AddField("configCursorClear", FieldDescription(((char *)&r.configCursorClear) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
195         td.AddField("configCursorMemory", FieldDescription(((char *)&r.configCursorMemory) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
196         td.AddField("configMusicLabel", FieldDescription(((char *)&r.configMusicLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
197         td.AddField("configMusicStereo", FieldDescription(((char *)&r.configMusicStereo) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
198         td.AddField("configMusicMono", FieldDescription(((char *)&r.configMusicMono) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
199
200         td.AddField("scenarioMenu", FieldDescription(((char *)&r.scenarioMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the scenario menu"));
201         td.AddField("scenarioMenuHeadline", FieldDescription(((char *)&r.scenarioMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
202
203         td.AddField("capsulebg", FieldDescription(((char *)&r.capsulebg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for the capsule menus"));
204
205         td.AddField("capsuleMenu", FieldDescription(((char *)&r.capsuleMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule main menu (the bottom bar)"));
206
207         td.AddField("capsuleFeedLabel", FieldDescription(((char *)&r.capsuleFeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
208         td.AddField("capsuleChangeLabel", FieldDescription(((char *)&r.capsuleChangeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
209         td.AddField("capsuleNameLabel", FieldDescription(((char *)&r.capsuleNameLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
210         td.AddField("capsuleClassLabel", FieldDescription(((char *)&r.capsuleClassLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
211         td.AddField("capsuleAlignmentLabel", FieldDescription(((char *)&r.capsuleAlignmentLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
212         td.AddField("capsuleTribeLabel", FieldDescription(((char *)&r.capsuleTribeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
213         td.AddField("capsuleAttack1Label", FieldDescription(((char *)&r.capsuleAttack1Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
214         td.AddField("capsuleAttack2Label", FieldDescription(((char *)&r.capsuleAttack2Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
215         td.AddField("capsuleAttack3Label", FieldDescription(((char *)&r.capsuleAttack3Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
216 }
217
218 void Resources::Construct(void *data) {
219         new (data) Resources;
220 }
221
222 }