X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FResources.cpp;h=74e4ccd89512e3f458023bb4cd9235da79b2ed31;hb=9666839d0ca6c794d28226a007870c82ef4ddb20;hp=38cf6f89534688dbd8f5d6d63de1b6b06220e91f;hpb=37f46a0eb5ddbf9e3de672cf6da97605e41bd1f4;p=l2e.git diff --git a/src/menu/Resources.cpp b/src/menu/Resources.cpp index 38cf6f8..74e4ccd 100644 --- a/src/menu/Resources.cpp +++ b/src/menu/Resources.cpp @@ -1,12 +1,24 @@ -/* - * Resources.cpp - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #include "Resources.h" +#include "../graphics/CharSelect.h" +#include "../graphics/Font.h" +#include "../graphics/Frame.h" +#include "../graphics/Menu.h" +#include "../graphics/Sprite.h" +#include "../graphics/Texture.h" +#include "../loader/Interpreter.h" +#include "../loader/TypeDescription.h" + +using graphics::CharSelect; +using graphics::Font; +using graphics::Frame; +using graphics::MenuProperties; +using graphics::Sprite; +using graphics::Texture; +using loader::FieldDescription; +using loader::Interpreter; +using loader::TypeDescription; + namespace menu { Resources::Resources() @@ -15,9 +27,6 @@ Resources::Resources() , inactiveFont(0) , statusFont(0) -, menuCursor(0) -, menuActiveCursor(0) - , statusLabels(0) , statusFrame(0) @@ -49,7 +58,9 @@ Resources::Resources() , gutLabel(0) , mgrLabel(0) +, hpLabel(0) , ipLabel(0) +, levelLabel(0) , experienceLabel(0) , nextLevelLabel(0) @@ -62,6 +73,7 @@ Resources::Resources() , itemMenuUseText(0) , itemMenuSortText(0) , itemMenuDropText(0) +, itemMenuSelectText(0) , inventoryMenuProperties(0) @@ -89,8 +101,140 @@ Resources::Resources() , configMusicMono(0) , scenarioMenuProperties(0) -, scenarioMenuHeadline(0) { +, scenarioMenuHeadline(0) + +, capsulebg(0) + +, capsuleMenuProperties(0) +, capsuleFeedMenuProperties(0) + +, capsuleFeedLabel(0) +, capsuleChangeLabel(0) +, capsuleNameLabel(0) +, capsuleClassLabel(0) +, capsuleAlignmentLabel(0) +, capsuleTribeLabel(0) +, capsuleAttack1Label(0) +, capsuleAttack2Label(0) +, capsuleAttack3Label(0) +, capsuleNoAttackText(0) +, capsuleNotHungryText(0) + +, capsuleNameCharSelectTemplate(0) + +{ } + + +void Resources::CreateTypeDescription() { + Resources r; + + TypeDescription &td(TypeDescription::Create(TYPE_ID, "MenuResources")); + td.SetConstructor(&Construct); + td.SetSize(sizeof(Resources)); + + td.AddField("menubg", FieldDescription(((char *)&r.menubg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for menus")); + + td.AddField("normalFont", FieldDescription(((char *)&r.normalFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("normal menu font")); + td.AddField("inactiveFont", FieldDescription(((char *)&r.inactiveFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("inactive menu font")); + td.AddField("statusFont", FieldDescription(((char *)&r.statusFont) - ((char *)&r), Font::TYPE_ID).SetReferenced().SetDescription("status font")); + + td.AddField("statusLabels", FieldDescription(((char *)&r.statusLabels) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("labels for the hero status")); + td.AddField("statusFrame", FieldDescription(((char *)&r.statusFrame) - ((char *)&r), Frame::TYPE_ID).SetReferenced().SetDescription("frame for almost every menu")); + + td.AddField("mainMenu", FieldDescription(((char *)&r.mainMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the main menu")); + td.AddField("mainMenuItemText", FieldDescription(((char *)&r.mainMenuItemText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuSpellText", FieldDescription(((char *)&r.mainMenuSpellText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuCapsuleText", FieldDescription(((char *)&r.mainMenuCapsuleText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuEquipmentText", FieldDescription(((char *)&r.mainMenuEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuStatusText", FieldDescription(((char *)&r.mainMenuStatusText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuChangeText", FieldDescription(((char *)&r.mainMenuChangeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuConfigText", FieldDescription(((char *)&r.mainMenuConfigText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuScenarioText", FieldDescription(((char *)&r.mainMenuScenarioText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("mainMenuTimeText", FieldDescription(((char *)&r.mainMenuTimeText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mainMenuGoldText", FieldDescription(((char *)&r.mainMenuGoldText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("heroCursor", FieldDescription(((char *)&r.heroCursor) - ((char *)&r), Sprite::TYPE_ID).SetReferenced().SetDescription("cursor for selecting a hero")); + td.AddField("heroCursorBlinkTime", FieldDescription(((char *)&r.heroCursorBlinkTime) - ((char *)&r), Interpreter::NUMBER_ID).SetReferenced().SetDescription("blinking interval (half) for the hero cursor")); + + td.AddField("noEquipmentText", FieldDescription(((char *)&r.noEquipmentText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + 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")); + + td.AddField("atpLabel", FieldDescription(((char *)&r.atpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("dfpLabel", FieldDescription(((char *)&r.dfpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("strLabel", FieldDescription(((char *)&r.strLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("aglLabel", FieldDescription(((char *)&r.aglLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("intLabel", FieldDescription(((char *)&r.intLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("gutLabel", FieldDescription(((char *)&r.gutLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("mgrLabel", FieldDescription(((char *)&r.mgrLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("hpLabel", FieldDescription(((char *)&r.hpLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("ipLabel", FieldDescription(((char *)&r.ipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("levelLabel", FieldDescription(((char *)&r.levelLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("experienceLabel", FieldDescription(((char *)&r.experienceLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("nextLevelLabel", FieldDescription(((char *)&r.nextLevelLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("statusMenu", FieldDescription(((char *)&r.statusMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the status menu")); + + td.AddField("nextLabel", FieldDescription(((char *)&r.nextLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("returnLabel", FieldDescription(((char *)&r.returnLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("itemMenu", FieldDescription(((char *)&r.itemMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the item menu")); + td.AddField("itemMenuUseText", FieldDescription(((char *)&r.itemMenuUseText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("itemMenuSortText", FieldDescription(((char *)&r.itemMenuSortText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("itemMenuDropText", FieldDescription(((char *)&r.itemMenuDropText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("itemMenuSelectText", FieldDescription(((char *)&r.itemMenuSelectText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("inventoryMenu", FieldDescription(((char *)&r.inventoryMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the inventory menu")); + td.AddField("spellMenu", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu")); + + td.AddField("equipmentActionMenu", FieldDescription(((char *)&r.equipmentActionMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the equipment action menu (the lower one)")); + 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)")); + td.AddField("equipMenuEquipLabel", FieldDescription(((char *)&r.equipMenuEquipLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("equipMenuStrongestLabel", FieldDescription(((char *)&r.equipMenuStrongestLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("equipMenuRemoveLabel", FieldDescription(((char *)&r.equipMenuRemoveLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("equipMenuRemoveAllLabel", FieldDescription(((char *)&r.equipMenuRemoveAllLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("equipMenuDropLabel", FieldDescription(((char *)&r.equipMenuDropLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("configMenu", FieldDescription(((char *)&r.configMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the configuration menu")); + td.AddField("configMessageSpeedLabel", FieldDescription(((char *)&r.configMessageSpeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMessageSpeedFast", FieldDescription(((char *)&r.configMessageSpeedFast) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMessageSpeedNormal", FieldDescription(((char *)&r.configMessageSpeedNormal) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMessageSpeedSlow", FieldDescription(((char *)&r.configMessageSpeedSlow) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configBattleCursorLabel", FieldDescription(((char *)&r.configBattleCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configStatusCursorLabel", FieldDescription(((char *)&r.configStatusCursorLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configCursorClear", FieldDescription(((char *)&r.configCursorClear) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configCursorMemory", FieldDescription(((char *)&r.configCursorMemory) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMusicLabel", FieldDescription(((char *)&r.configMusicLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMusicStereo", FieldDescription(((char *)&r.configMusicStereo) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("configMusicMono", FieldDescription(((char *)&r.configMusicMono) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("scenarioMenu", FieldDescription(((char *)&r.scenarioMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the scenario menu")); + td.AddField("scenarioMenuHeadline", FieldDescription(((char *)&r.scenarioMenuHeadline) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("capsulebg", FieldDescription(((char *)&r.capsulebg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for the capsule menus")); + + td.AddField("capsuleMenu", FieldDescription(((char *)&r.capsuleMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule main menu (the bottom bar)")); + td.AddField("capsuleFeedMenu", FieldDescription(((char *)&r.capsuleFeedMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule feed menu (above the inventory)")); + + td.AddField("capsuleFeedLabel", FieldDescription(((char *)&r.capsuleFeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleChangeLabel", FieldDescription(((char *)&r.capsuleChangeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleNameLabel", FieldDescription(((char *)&r.capsuleNameLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleClassLabel", FieldDescription(((char *)&r.capsuleClassLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleAlignmentLabel", FieldDescription(((char *)&r.capsuleAlignmentLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleTribeLabel", FieldDescription(((char *)&r.capsuleTribeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleAttack1Label", FieldDescription(((char *)&r.capsuleAttack1Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleAttack2Label", FieldDescription(((char *)&r.capsuleAttack2Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleAttack3Label", FieldDescription(((char *)&r.capsuleAttack3Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleNoAttackText", FieldDescription(((char *)&r.capsuleNoAttackText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + td.AddField("capsuleNotHungryText", FieldDescription(((char *)&r.capsuleNotHungryText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced()); + + td.AddField("capsuleNameSelect", FieldDescription(((char *)&r.capsuleNameCharSelectTemplate) - ((char *)&r), CharSelect::TYPE_ID).SetReferenced().SetDescription("properties of the letter array for changing the capsule name")); +} +void Resources::Construct(void *data) { + new (data) Resources; } }