X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FResources.cpp;h=a355909d87b1412bba23871fdd8102a0b060e1a6;hb=7a14d357d9d05c2bac1efcdcf57365a4ce13729a;hp=166fbf70368f15a42dd8eac25a9d66184db5bfe1;hpb=243cb7d922fe888be8d18241de138ad5949de430;p=l2e.git diff --git a/src/menu/Resources.cpp b/src/menu/Resources.cpp index 166fbf7..a355909 100644 --- a/src/menu/Resources.cpp +++ b/src/menu/Resources.cpp @@ -1,17 +1,28 @@ -/* - * Resources.cpp - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #include "Resources.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::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() : menubg(0) , normalFont(0) +, inactiveFont(0) , statusFont(0) , statusLabels(0) @@ -35,8 +46,189 @@ Resources::Resources() , noEquipmentText(0) -, shoulderNav(0) { +, shoulderNav(0) + +, atpLabel(0) +, dfpLabel(0) +, strLabel(0) +, aglLabel(0) +, intLabel(0) +, gutLabel(0) +, mgrLabel(0) + +, hpLabel(0) +, ipLabel(0) +, levelLabel(0) +, experienceLabel(0) +, nextLevelLabel(0) + +, statusMenuProperties(0) + +, nextLabel(0) +, returnLabel(0) + +, itemMenuProperties(0) +, itemMenuUseText(0) +, itemMenuSortText(0) +, itemMenuDropText(0) +, itemMenuSelectText(0) + +, inventoryMenuProperties(0) + +, spellMenuProperties(0) + +, equipmentActionMenuProperties(0) +, equipmentMenuProperties(0) +, equipMenuEquipLabel(0) +, equipMenuStrongestLabel(0) +, equipMenuRemoveLabel(0) +, equipMenuRemoveAllLabel(0) +, equipMenuDropLabel(0) + +, configMenuProperties(0) +, configMessageSpeedLabel(0) +, configMessageSpeedFast(0) +, configMessageSpeedNormal(0) +, configMessageSpeedSlow(0) +, configBattleCursorLabel(0) +, configStatusCursorLabel(0) +, configCursorClear(0) +, configCursorMemory(0) +, configMusicLabel(0) +, configMusicStereo(0) +, configMusicMono(0) + +, scenarioMenuProperties(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) + +{ } + + +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()); +} +void Resources::Construct(void *data) { + new (data) Resources; } }