3 #include "../graphics/CharSelect.h"
4 #include "../graphics/Font.h"
5 #include "../graphics/Frame.h"
6 #include "../graphics/Menu.h"
7 #include "../graphics/Sprite.h"
8 #include "../graphics/Texture.h"
9 #include "../loader/Interpreter.h"
10 #include "../loader/TypeDescription.h"
12 using graphics::CharSelect;
14 using graphics::Frame;
15 using graphics::MenuProperties;
16 using graphics::Sprite;
17 using graphics::Texture;
18 using loader::FieldDescription;
19 using loader::Interpreter;
20 using loader::TypeDescription;
24 Resources::Resources()
33 , mainMenuProperties(0)
35 , mainMenuSpellText(0)
36 , mainMenuCapsuleText(0)
37 , mainMenuEquipmentText(0)
38 , mainMenuStatusText(0)
39 , mainMenuChangeText(0)
40 , mainMenuConfigText(0)
41 , mainMenuScenarioText(0)
47 , heroCursorBlinkTime(0)
67 , statusMenuProperties(0)
72 , itemMenuProperties(0)
76 , itemMenuSelectText(0)
78 , inventoryMenuProperties(0)
80 , spellMenuProperties(0)
82 , equipmentActionMenuProperties(0)
83 , equipmentMenuProperties(0)
84 , equipMenuEquipLabel(0)
85 , equipMenuStrongestLabel(0)
86 , equipMenuRemoveLabel(0)
87 , equipMenuRemoveAllLabel(0)
88 , equipMenuDropLabel(0)
90 , configMenuProperties(0)
91 , configMessageSpeedLabel(0)
92 , configMessageSpeedFast(0)
93 , configMessageSpeedNormal(0)
94 , configMessageSpeedSlow(0)
95 , configBattleCursorLabel(0)
96 , configStatusCursorLabel(0)
97 , configCursorClear(0)
98 , configCursorMemory(0)
100 , configMusicStereo(0)
103 , scenarioMenuProperties(0)
104 , scenarioMenuHeadline(0)
108 , capsuleMenuProperties(0)
109 , capsuleFeedMenuProperties(0)
111 , capsuleFeedLabel(0)
112 , capsuleChangeLabel(0)
113 , capsuleNameLabel(0)
114 , capsuleClassLabel(0)
115 , capsuleAlignmentLabel(0)
116 , capsuleTribeLabel(0)
117 , capsuleAttack1Label(0)
118 , capsuleAttack2Label(0)
119 , capsuleAttack3Label(0)
120 , capsuleNoAttackText(0)
121 , capsuleNotHungryText(0)
123 , capsuleNameCharSelectTemplate(0)
125 , capsuleSelectTopLeft(0)
126 , capsuleSelectTopRight(0)
127 , capsuleSelectTopRepeat(0)
128 , capsuleSelectBottomLeft(0)
129 , capsuleSelectBottomRight(0)
130 , capsuleSelectBottomRepeat(0)
131 , capsuleSelectLeftRepeat(0)
132 , capsuleSelectRightRepeat(0)
133 , capsuleSelectLadder(0)
134 , capsuleSelectCursor(0)
136 , capsuleAlignmentWheel(0)
137 , capsuleAlignmentCursor(0)
142 void Resources::CreateTypeDescription() {
145 TypeDescription &td(TypeDescription::Create(TYPE_ID, "MenuResources"));
146 td.SetConstructor(&Construct);
147 td.SetSize(sizeof(Resources));
149 td.AddField("menubg", FieldDescription(((char *)&r.menubg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for menus"));
151 td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("normal menu font"));
152 td.AddField("inactiveFont", FieldDescription(((char *)&r.inactiveFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("inactive menu font"));
153 td.AddField("statusFont", FieldDescription(((char *)&r.statusFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("status font"));
155 td.AddField("statusLabels", FieldDescription(((char *)&r.statusLabels) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("labels for the hero status"));
156 td.AddField("statusFrame", FieldDescription(((char *)&r.statusFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for almost every menu"));
158 td.AddField("mainMenu", FieldDescription(((char *)&r.mainMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the main menu"));
159 td.AddField("mainMenuItemText", FieldDescription(((char *)&r.mainMenuItemText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
160 td.AddField("mainMenuSpellText", FieldDescription(((char *)&r.mainMenuSpellText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
161 td.AddField("mainMenuCapsuleText", FieldDescription(((char *)&r.mainMenuCapsuleText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
162 td.AddField("mainMenuEquipmentText", FieldDescription(((char *)&r.mainMenuEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
163 td.AddField("mainMenuStatusText", FieldDescription(((char *)&r.mainMenuStatusText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
164 td.AddField("mainMenuChangeText", FieldDescription(((char *)&r.mainMenuChangeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
165 td.AddField("mainMenuConfigText", FieldDescription(((char *)&r.mainMenuConfigText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
166 td.AddField("mainMenuScenarioText", FieldDescription(((char *)&r.mainMenuScenarioText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
168 td.AddField("mainMenuTimeText", FieldDescription(((char *)&r.mainMenuTimeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
169 td.AddField("mainMenuGoldText", FieldDescription(((char *)&r.mainMenuGoldText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
171 td.AddField("heroCursor", FieldDescription(((char *)&r.heroCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selecting a hero"));
172 td.AddField("heroCursorBlinkTime", FieldDescription(((char *)&r.heroCursorBlinkTime) - ((char *)&r), Interpreter::NUMBER_ID).SetReferenced().SetDescription("blinking interval (half) for the hero cursor"));
174 td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
176 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"));
178 td.AddField("atpLabel", FieldDescription(((char *)&r.atpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
179 td.AddField("dfpLabel", FieldDescription(((char *)&r.dfpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
180 td.AddField("strLabel", FieldDescription(((char *)&r.strLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
181 td.AddField("aglLabel", FieldDescription(((char *)&r.aglLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
182 td.AddField("intLabel", FieldDescription(((char *)&r.intLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
183 td.AddField("gutLabel", FieldDescription(((char *)&r.gutLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
184 td.AddField("mgrLabel", FieldDescription(((char *)&r.mgrLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
186 td.AddField("hpLabel", FieldDescription(((char *)&r.hpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
187 td.AddField("ipLabel", FieldDescription(((char *)&r.ipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
188 td.AddField("levelLabel", FieldDescription(((char *)&r.levelLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
189 td.AddField("experienceLabel", FieldDescription(((char *)&r.experienceLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
190 td.AddField("nextLevelLabel", FieldDescription(((char *)&r.nextLevelLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
192 td.AddField("statusMenu", FieldDescription(((char *)&r.statusMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the status menu"));
194 td.AddField("nextLabel", FieldDescription(((char *)&r.nextLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
195 td.AddField("returnLabel", FieldDescription(((char *)&r.returnLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
197 td.AddField("itemMenu", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the item menu"));
198 td.AddField("itemMenuUseText", FieldDescription(((char *)&r.itemMenuUseText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
199 td.AddField("itemMenuSortText", FieldDescription(((char *)&r.itemMenuSortText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
200 td.AddField("itemMenuDropText", FieldDescription(((char *)&r.itemMenuDropText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
201 td.AddField("itemMenuSelectText", FieldDescription(((char *)&r.itemMenuSelectText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
203 td.AddField("inventoryMenu", FieldDescription(((char *)&r.inventoryMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the inventory menu"));
204 td.AddField("spellMenu", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu"));
206 td.AddField("equipmentActionMenu", FieldDescription(((char *)&r.equipmentActionMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the equipment action menu (the lower one)"));
207 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)"));
208 td.AddField("equipMenuEquipLabel", FieldDescription(((char *)&r.equipMenuEquipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
209 td.AddField("equipMenuStrongestLabel", FieldDescription(((char *)&r.equipMenuStrongestLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
210 td.AddField("equipMenuRemoveLabel", FieldDescription(((char *)&r.equipMenuRemoveLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
211 td.AddField("equipMenuRemoveAllLabel", FieldDescription(((char *)&r.equipMenuRemoveAllLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
212 td.AddField("equipMenuDropLabel", FieldDescription(((char *)&r.equipMenuDropLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
214 td.AddField("configMenu", FieldDescription(((char *)&r.configMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the configuration menu"));
215 td.AddField("configMessageSpeedLabel", FieldDescription(((char *)&r.configMessageSpeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
216 td.AddField("configMessageSpeedFast", FieldDescription(((char *)&r.configMessageSpeedFast) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
217 td.AddField("configMessageSpeedNormal", FieldDescription(((char *)&r.configMessageSpeedNormal) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
218 td.AddField("configMessageSpeedSlow", FieldDescription(((char *)&r.configMessageSpeedSlow) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
219 td.AddField("configBattleCursorLabel", FieldDescription(((char *)&r.configBattleCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
220 td.AddField("configStatusCursorLabel", FieldDescription(((char *)&r.configStatusCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
221 td.AddField("configCursorClear", FieldDescription(((char *)&r.configCursorClear) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
222 td.AddField("configCursorMemory", FieldDescription(((char *)&r.configCursorMemory) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
223 td.AddField("configMusicLabel", FieldDescription(((char *)&r.configMusicLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
224 td.AddField("configMusicStereo", FieldDescription(((char *)&r.configMusicStereo) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
225 td.AddField("configMusicMono", FieldDescription(((char *)&r.configMusicMono) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
227 td.AddField("scenarioMenu", FieldDescription(((char *)&r.scenarioMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the scenario menu"));
228 td.AddField("scenarioMenuHeadline", FieldDescription(((char *)&r.scenarioMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
230 td.AddField("capsulebg", FieldDescription(((char *)&r.capsulebg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for the capsule menus"));
232 td.AddField("capsuleMenu", FieldDescription(((char *)&r.capsuleMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule main menu (the bottom bar)"));
233 td.AddField("capsuleFeedMenu", FieldDescription(((char *)&r.capsuleFeedMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule feed menu (above the inventory)"));
235 td.AddField("capsuleFeedLabel", FieldDescription(((char *)&r.capsuleFeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
236 td.AddField("capsuleChangeLabel", FieldDescription(((char *)&r.capsuleChangeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
237 td.AddField("capsuleNameLabel", FieldDescription(((char *)&r.capsuleNameLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
238 td.AddField("capsuleClassLabel", FieldDescription(((char *)&r.capsuleClassLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
239 td.AddField("capsuleAlignmentLabel", FieldDescription(((char *)&r.capsuleAlignmentLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
240 td.AddField("capsuleTribeLabel", FieldDescription(((char *)&r.capsuleTribeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
241 td.AddField("capsuleAttack1Label", FieldDescription(((char *)&r.capsuleAttack1Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
242 td.AddField("capsuleAttack2Label", FieldDescription(((char *)&r.capsuleAttack2Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
243 td.AddField("capsuleAttack3Label", FieldDescription(((char *)&r.capsuleAttack3Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
244 td.AddField("capsuleNoAttackText", FieldDescription(((char *)&r.capsuleNoAttackText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
245 td.AddField("capsuleNotHungryText", FieldDescription(((char *)&r.capsuleNotHungryText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
247 td.AddField("capsuleNameSelect", FieldDescription(((char *)&r.capsuleNameCharSelectTemplate) - ((char *)&r), CharSelect::TYPE_ID).SetReferenced().SetDescription("properties of the letter array for changing the capsule name"));
249 td.AddField("capsuleSelectTopLeft", FieldDescription(((char *)&r.capsuleSelectTopLeft) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
250 td.AddField("capsuleSelectTopRight", FieldDescription(((char *)&r.capsuleSelectTopRight) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
251 td.AddField("capsuleSelectTopRepeat", FieldDescription(((char *)&r.capsuleSelectTopRepeat) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
252 td.AddField("capsuleSelectBottomLeft", FieldDescription(((char *)&r.capsuleSelectBottomLeft) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
253 td.AddField("capsuleSelectBottomRight", FieldDescription(((char *)&r.capsuleSelectBottomRight) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
254 td.AddField("capsuleSelectBottomRepeat", FieldDescription(((char *)&r.capsuleSelectBottomRepeat) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
255 td.AddField("capsuleSelectLeftRepeat", FieldDescription(((char *)&r.capsuleSelectLeftRepeat) - ((char *)&r), Texture::TYPE_ID).SetReferenced());
256 td.AddField("capsuleSelectRightRepeat", FieldDescription(((char *)&r.capsuleSelectRightRepeat) - ((char *)&r), Texture::TYPE_ID).SetReferenced());
257 td.AddField("capsuleSelectLadder", FieldDescription(((char *)&r.capsuleSelectLadder) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
258 td.AddField("capsuleSelectCursor", FieldDescription(((char *)&r.capsuleSelectCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
260 td.AddField("capsuleAlignmentWheel", FieldDescription(((char *)&r.capsuleAlignmentWheel) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
261 td.AddField("capsuleAlignmentCursor", FieldDescription(((char *)&r.capsuleAlignmentCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced());
264 void Resources::Construct(void *data) {
265 new (data) Resources;