From: Daniel Karbach Date: Sun, 2 Sep 2012 16:53:20 +0000 (+0200) Subject: added interpretation of battle resources X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=953e7c370a2f955d2aaf9b41a3e9cc3a4911c852;p=l2e.git added interpretation of battle resources --- diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp index 372a114..fcfe473 100644 --- a/src/loader/Interpreter.cpp +++ b/src/loader/Interpreter.cpp @@ -11,6 +11,7 @@ #include "../battle/Hero.h" #include "../battle/Monster.h" #include "../battle/PartyLayout.h" +#include "../battle/Resources.h" #include "../common/Ikari.h" #include "../common/Item.h" #include "../common/Spell.h" @@ -53,6 +54,9 @@ using std::vector; namespace loader { Interpreter::~Interpreter() { + for (vector::const_iterator i(battleResources.begin()), end(battleResources.end()); i != end; ++i) { + delete *i; + } for (vector::const_iterator i(complexAnimations.begin()), end(complexAnimations.end()); i != end; ++i) { delete *i; } @@ -119,6 +123,19 @@ Animation *Interpreter::GetAnimation(const std::string &name) { } } +battle::Resources *Interpreter::GetBattleResources(const std::string &name) { + map::const_iterator i(parsedDefinitions.find(name)); + if (i != parsedDefinitions.end()) { + if (i->second.type == BATTLE_RESOURCES) { + return battleResources[i->second.index]; + } else { + throw Error("cannot cast " + i->second.dfn->TypeName() + " to BattleResources"); + } + } else { + throw Error("access to undefined BattleResources " + name); + } +} + bool Interpreter::GetBoolean(const std::string &name) const { map::const_iterator i(parsedDefinitions.find(name)); if (i != parsedDefinitions.end()) { @@ -441,6 +458,17 @@ Animation *Interpreter::GetAnimation(const Value &v) { } } +battle::Resources *Interpreter::GetBattleResources(const Value &v) { + if (v.IsLiteral()) { + battle::Resources *r(new battle::Resources); + ReadBattleResources(*r, *v.GetLiteral().GetProperties()); + return r; + } else { + ReadDefinition(source.GetDefinition(v.GetIdentifier())); + return GetBattleResources(v.GetIdentifier()); + } +} + bool Interpreter::GetBoolean(const Value &v) { if (v.IsLiteral()) { return v.GetLiteral().GetBoolean(); @@ -666,7 +694,13 @@ const vector &Interpreter::GetValueArray(const Value &v) { void Interpreter::ReadObject(const Definition &dfn) { - if (dfn.TypeName() == "ComplexAnimation") { + if (dfn.TypeName() == "BattleResources") { + battle::Resources *res(new battle::Resources); + int index(battleResources.size()); + battleResources.push_back(res); + ReadBattleResources(*res, *dfn.GetProperties()); + parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, BATTLE_RESOURCES, index))); + } else if (dfn.TypeName() == "ComplexAnimation") { ComplexAnimation *animation(new ComplexAnimation); int index(complexAnimations.size()); complexAnimations.push_back(animation); @@ -756,6 +790,114 @@ void Interpreter::ReadObject(const Definition &dfn) { } +void Interpreter::ReadBattleResources(battle::Resources &res, const PropertyList &props) { + for (PropertyList::ConstIterator i(props.Begin()), end(props.End()); i != end; ++i) { + if (i->first == "swapCursor") { + res.swapCursor = GetSprite(*i->second); + } else if (i->first == "moveIcons") { + res.moveIcons = GetSprite(*i->second); + } else if (i->first == "attackIcons") { + res.attackIcons = GetSprite(*i->second); + } else if (i->first == "attackChoiceIcons") { + res.attackChoiceIcons = GetSprite(*i->second); + } else if (i->first == "titleFrame") { + res.titleFrame = GetFrame(*i->second); + } else if (i->first == "titleFont") { + res.titleFont = GetFont(*i->second); + } else if (i->first == "heroTagFrame") { + res.heroTagFrame = GetFrame(*i->second); + } else if (i->first == "activeHeroTagFrame") { + res.activeHeroTagFrame = GetFrame(*i->second); + } else if (i->first == "smallHeroTagFrame") { + res.smallHeroTagFrame = GetFrame(*i->second); + } else if (i->first == "lastSmallHeroTagFrame") { + res.lastSmallHeroTagFrame = GetFrame(*i->second); + } else if (i->first == "heroTagFont") { + res.heroTagFont = GetFont(*i->second); + } else if (i->first == "heroTagLabels") { + res.heroTagLabels = GetSprite(*i->second); + } else if (i->first == "healthGauge") { + res.healthGauge = GetGauge(*i->second); + } else if (i->first == "manaGauge") { + res.manaGauge = GetGauge(*i->second); + } else if (i->first == "ikariGauge") { + res.ikariGauge = GetGauge(*i->second); + } else if (i->first == "selectFrame") { + res.selectFrame = GetFrame(*i->second); + } else if (i->first == "normalFont") { + res.normalFont = GetFont(*i->second); + } else if (i->first == "disabledFont") { + res.disabledFont = GetFont(*i->second); + } else if (i->first == "menuCursor") { + res.menuCursor = GetSprite(*i->second); + } else if (i->first == "weaponTargetCursor") { + res.weaponTargetCursor = GetSprite(*i->second); + } else if (i->first == "magicTargetCursor") { + res.magicTargetCursor = GetSprite(*i->second); + } else if (i->first == "itemTargetCursor") { + res.itemTargetCursor = GetSprite(*i->second); + } else if (i->first == "spellMenuHeadline") { + res.spellMenuHeadline = GetString(*i->second); + } else if (i->first == "spellMenuProperties") { + res.spellMenuProperties = GetMenuProperties(*i->second); + } else if (i->first == "itemMenuHeadline") { + res.itemMenuHeadline = GetString(*i->second); + } else if (i->first == "itemMenuProperties") { + res.itemMenuProperties = GetMenuProperties(*i->second); + } else if (i->first == "ikariMenuHeadline") { + res.ikariMenuHeadline = GetString(*i->second); + } else if (i->first == "ikariMenuProperties") { + res.ikariMenuProperties = GetMenuProperties(*i->second); + } else if (i->first == "noEquipmentText") { + res.noEquipmentText = GetString(*i->second); + } else if (i->first == "escapeText") { + res.escapeText = GetString(*i->second); + } else if (i->first == "numberAnimationPrototype") { + res.numberAnimationPrototype = GetAnimation(*i->second); + } else if (i->first == "bigNumberSprite") { + res.bigNumberSprite = GetSprite(*i->second); + } else if (i->first == "greenNumberSprite") { + res.greenNumberSprite = GetSprite(*i->second); + } else if (i->first == "weaponMenuIcon") { + res.weaponMenuIcon = GetSprite(*i->second); + } else if (i->first == "armorMenuIcon") { + res.armorMenuIcon = GetSprite(*i->second); + } else if (i->first == "shieldMenuIcon") { + res.shieldMenuIcon = GetSprite(*i->second); + } else if (i->first == "helmetMenuIcon") { + res.helmetMenuIcon = GetSprite(*i->second); + } else if (i->first == "ringMenuIcon") { + res.ringMenuIcon = GetSprite(*i->second); + } else if (i->first == "jewelMenuIcon") { + res.jewelMenuIcon = GetSprite(*i->second); + } else if (i->first == "levelLabelCol") { + res.levelLabelCol = GetNumber(*i->second); + } else if (i->first == "levelLabelRow") { + res.levelLabelRow = GetNumber(*i->second); + } else if (i->first == "healthLabelCol") { + res.healthLabelCol = GetNumber(*i->second); + } else if (i->first == "healthLabelRow") { + res.healthLabelRow = GetNumber(*i->second); + } else if (i->first == "manaLabelCol") { + res.manaLabelCol = GetNumber(*i->second); + } else if (i->first == "manaLabelRow") { + res.manaLabelRow = GetNumber(*i->second); + } else if (i->first == "moveLabelCol") { + res.moveLabelCol = GetNumber(*i->second); + } else if (i->first == "moveLabelRow") { + res.moveLabelRow = GetNumber(*i->second); + } else if (i->first == "ikariLabelCol") { + res.ikariLabelCol = GetNumber(*i->second); + } else if (i->first == "ikariLabelRow") { + res.ikariLabelRow = GetNumber(*i->second); + } else if (i->first == "heroesBgColor") { + res.heroesBgColor = GetColor(*i->second); + } else { + throw Error("unknown BattleResources property: " + i->first); + } + } +} + void Interpreter::ReadComplexAnimation(ComplexAnimation &a, const PropertyList &props) { for (PropertyList::ConstIterator i(props.Begin()), end(props.End()); i != end; ++i) { if (i->first == "sprite") { diff --git a/src/loader/Interpreter.h b/src/loader/Interpreter.h index e72d4da..044a3c0 100644 --- a/src/loader/Interpreter.h +++ b/src/loader/Interpreter.h @@ -22,6 +22,7 @@ namespace battle { class Hero; class Monster; class PartyLayout; + struct Resources; class Stats; } @@ -69,6 +70,7 @@ public: public: graphics::Animation *GetAnimation(const std::string &name); + battle::Resources *GetBattleResources(const std::string &name); bool GetBoolean(const std::string &name) const; const graphics::Color &GetColor(const std::string &name) const; graphics::Font *GetFont(const std::string &name); @@ -89,6 +91,7 @@ public: geometry::Vector GetVector(const std::string &name) const; public: + const std::vector &BattleResources() const { return battleResources; } const std::vector &Booleans() const { return booleans; } const std::vector &Colors() const { return colors; } const std::vector &ComplexAnimations() const { return complexAnimations; } @@ -116,6 +119,7 @@ private: void ReadObject(const Definition &); graphics::Animation *GetAnimation(const Value &); + battle::Resources *GetBattleResources(const Value &); graphics::Color GetColor(const Value &); bool GetBoolean(const Value &); graphics::Font *GetFont(const Value &); @@ -139,6 +143,7 @@ private: const std::vector &GetValueArray(const Value &); geometry::Vector GetVector(const Value &); + void ReadBattleResources(battle::Resources &, const PropertyList &); void ReadComplexAnimation(graphics::ComplexAnimation &, const PropertyList &); void ReadComplexAnimationFrame(graphics::ComplexAnimation::FrameProp &, const PropertyList &); void ReadFont(graphics::Font &, const PropertyList &); @@ -159,6 +164,7 @@ private: private: const ParsedSource &source; enum Type { + BATTLE_RESOURCES, BOOLEAN, COLOR, COMPLEX_ANIMATION, @@ -194,6 +200,7 @@ private: std::map imageCache; + std::vector battleResources; std::vector booleans; std::vector colors; std::vector complexAnimations; diff --git a/src/main.cpp b/src/main.cpp index 491a0ec..9d8e8d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -99,49 +99,7 @@ int main(int argc, char **argv) { Hero guy(*intp.GetHero("guy")); Hero dekar(*intp.GetHero("dekar")); - battle::Resources battleRes; - - battleRes.swapCursor = intp.GetSprite("swapCursor"); - battleRes.attackIcons = intp.GetSprite("attackIcons"); - battleRes.attackChoiceIcons = intp.GetSprite("attackChoiceIcons"); - battleRes.moveIcons = intp.GetSprite("moveIcons"); - battleRes.titleFrame = intp.GetFrame("titleFrame"); - battleRes.titleFont = intp.GetFont("largeFont"); - battleRes.numberAnimationPrototype = intp.GetAnimation("numberAnimationPrototype"); - battleRes.bigNumberSprite = intp.GetSprite("bigNumbers"); - battleRes.greenNumberSprite = intp.GetSprite("bigGreenNumbers"); - - battleRes.heroTagLabels = intp.GetSprite("heroTagLabels"); - battleRes.levelLabelCol = 0; - battleRes.levelLabelRow = 0; - battleRes.healthLabelCol = 0; - battleRes.healthLabelRow = 1; - battleRes.manaLabelCol = 0; - battleRes.manaLabelRow = 2; - battleRes.moveLabelCol = 0; - battleRes.moveLabelRow = 3; - battleRes.ikariLabelCol = 0; - battleRes.ikariLabelRow = 4; - - battleRes.heroTagFont = intp.GetFont("heroTagFont"); - battleRes.heroTagFrame = intp.GetFrame("heroTagFrame"); - battleRes.activeHeroTagFrame = intp.GetFrame("activeHeroTagFrame"); - battleRes.smallHeroTagFrame = intp.GetFrame("smallHeroTagFrame"); - battleRes.lastSmallHeroTagFrame = intp.GetFrame("lastSmallHeroTagFrame"); - battleRes.heroesBgColor = intp.GetColor("heroesBgColor"); - - battleRes.healthGauge = intp.GetGauge("healthGauge"); - battleRes.manaGauge = intp.GetGauge("manaGauge"); - battleRes.ikariGauge = intp.GetGauge("ikariGauge"); - - battleRes.selectFrame = intp.GetFrame("selectFrame"); - battleRes.normalFont = intp.GetFont("normalFont"); - battleRes.disabledFont = intp.GetFont("disabledFont"); - battleRes.menuCursor = intp.GetSprite("handCursor"); - - battleRes.weaponTargetCursor = intp.GetSprite("weaponTargetCursor"); - battleRes.magicTargetCursor = intp.GetSprite("magicTargetCursor"); - battleRes.itemTargetCursor = intp.GetSprite("itemTargetCursor"); + battle::Resources *battleRes(intp.GetBattleResources("battleResources")); maxim.AddSpell(intp.GetSpell("resetSpell")); Spell *strongSpell(intp.GetSpell("strongSpell")); @@ -161,16 +119,6 @@ int main(int argc, char **argv) { maxim.AddSpell(valorSpell); selan.AddSpell(valorSpell); - battleRes.spellMenuHeadline = intp.GetString("spellMenuHeadline"); - battleRes.spellMenuProperties = intp.GetMenuProperties("spellMenuPrototype"); - - battleRes.weaponMenuIcon = intp.GetSprite("swordIcon"); - battleRes.armorMenuIcon = intp.GetSprite("armorIcon"); - battleRes.shieldMenuIcon = intp.GetSprite("shieldIcon"); - battleRes.helmetMenuIcon = intp.GetSprite("helmetIcon"); - battleRes.ringMenuIcon = intp.GetSprite("ringIcon"); - battleRes.jewelMenuIcon = intp.GetSprite("jewelIcon"); - Inventory inventory; inventory.Add(intp.GetItem("antidoteItem"), 9); inventory.Add(intp.GetItem("magicJarItem"), 4); @@ -178,10 +126,7 @@ int main(int argc, char **argv) { inventory.Add(intp.GetItem("powerPotionItem"), 4); inventory.Add(intp.GetItem("escapeItem"), 2); inventory.Add(intp.GetItem("sleepBallItem"), 1); - battleRes.inventory = &inventory; - - battleRes.itemMenuHeadline = intp.GetString("itemMenuHeadline"); - battleRes.itemMenuProperties = intp.GetMenuProperties("itemMenuPrototype"); + battleRes->inventory = &inventory; maxim.SetWeapon(intp.GetItem("zircoSwordItem")); maxim.SetArmor(intp.GetItem("zirconArmorItem")); @@ -212,12 +157,7 @@ int main(int argc, char **argv) { dekar.SetRing(intp.GetItem("rocketRingItem")); dekar.SetJewel(intp.GetItem("krakenRockItem")); - battleRes.ikariMenuHeadline = intp.GetString("ikariMenuHeadline"); - battleRes.noEquipmentText = intp.GetString("noEquipmentText"); - battleRes.ikariMenuProperties = intp.GetMenuProperties("ikariMenuPrototype"); - battleRes.escapeText = intp.GetString("escapeText"); - - BattleState *battleState(new BattleState(bg, monstersLayout, heroesLayout, &battleRes)); + BattleState *battleState(new BattleState(bg, monstersLayout, heroesLayout, battleRes)); battleState->AddMonster(monster); battleState->AddMonster(monster); battleState->AddMonster(monster); diff --git a/test-data/test.l2s b/test-data/test.l2s index 65da87a..098e0b2 100644 --- a/test-data/test.l2s +++ b/test-data/test.l2s @@ -335,229 +335,256 @@ export Hero dekar { } } -export Sprite swapCursor { - image: :"swap-cursor.png", - size: <32,32> -} -export Sprite attackIcons { - image: :"attack-type-icons.png", - size: <32,32> -} -export Sprite attackChoiceIcons { - image: :"attack-choice-icons.png", - size: <16,16> -} -export Sprite moveIcons { - image: :"move-icons.png", +Sprite handCursor { + image: :"cursor-hand.png", size: <32,32> } -export Frame titleFrame { - image: :"title-frame.png", - border: <16,16> -} - -export Font largeFont { - sprite: Sprite { - image: :"large-font.png", - size: <16,32> - }, - rowoffset: -2 -} - -export ComplexAnimation numberAnimationPrototype { - frametime: frameTime, - repeat: false, - frames: [ - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0,-26> }, - { column: 0, row: 0, disposition: < 0,-42> }, - { column: 0, row: 0, disposition: < 0,-48> }, - { column: 0, row: 0, disposition: < 0,-42> }, - { column: 0, row: 0, disposition: < 0,-26> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0,-12> }, - { column: 0, row: 0, disposition: < 0,-20> }, - { column: 0, row: 0, disposition: < 0,-24> }, - { column: 0, row: 0, disposition: < 0,-20> }, - { column: 0, row: 0, disposition: < 0,-12> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, -6> }, - { column: 0, row: 0, disposition: < 0,-10> }, - { column: 0, row: 0, disposition: < 0,-12> }, - { column: 0, row: 0, disposition: < 0,-10> }, - { column: 0, row: 0, disposition: < 0, -6> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0, 0> }, - { column: 0, row: 0, disposition: < 0,-36> }, - { column: 0, row: 0, disposition: < 0,-32> }, - { column: 0, row: 0, disposition: < 0,-18> } - ] -} -export Sprite bigNumbers { - image: :"big-numbers.png", - size: <16,32> -} -export Sprite bigGreenNumbers { - image: :"big-green-numbers.png", - size: <16,32> -} - -export Sprite heroTagLabels { - image: :"hero-tag-sprites.png", - size: <32,16> -} -export Font heroTagFont { - sprite: Sprite { - image: :"numbers.png", - size: <16,16> - }, - rowoffset: -3 -} - -export Frame activeHeroTagFrame { - image: :"tag-frames.png", - border: <16,16> -} -export Frame heroTagFrame { - image: :"tag-frames.png", - border: <16,16>, - offset: < 0,33> -} - -export Frame smallHeroTagFrame { - image: :"small-tag-frame.png", - border: <8,16> -} -export Frame lastSmallHeroTagFrame { - image: :"small-tag-frame.png", - border: <8,16>, - offset: <0,33> -} -export Color heroesBgColor (24, 40, 49) - -export Gauge healthGauge { - image: :"gauges.png", - full: <0,16>, - empty: <0, 0>, - height: 16, - start: 6, - repeat: 1, - end: 6 -} -export Gauge manaGauge { - image: :"gauges.png", - full: <0,32>, - empty: <0, 0>, - height: 16, - start: 6, - repeat: 1, - end: 6 -} -export Gauge ikariGauge { - image: :"gauges.png", - full: <0,48>, - empty: <0, 0>, - height: 16, - start: 6, - repeat: 1, - end: 6 -} - -export Frame selectFrame { - image: :"select-frame.png", - border: <16,16> -} -export Font normalFont { +Font normalFont { sprite: Sprite { image: :"normal-font.png", size: <16,16> }, rowoffset: -2 } -export Font disabledFont { + +Font disabledFont { sprite: Sprite { image: :"disabled-font.png", size: <16,16> }, rowoffset: -2 } -export Sprite handCursor { - image: :"cursor-hand.png", - size: <32,32> -} - -export Sprite weaponTargetCursor { - image: :"targeting-icons.png", - size: <32,32> -} -export Sprite magicTargetCursor { - image: :"targeting-icons.png", - size: <32,32>, - offset: <0,32> -} -export Sprite itemTargetCursor { - image: :"targeting-icons.png", - size: <32,32>, - offset: <0,64> -} -export String spellMenuHeadline "Please choose a spell." -export MenuProperties spellMenuPrototype { - font: normalFont, - disabledFont: disabledFont, - cursor: handCursor, - charsPerEntry: 9, - rows: 6, - rowGap: 8, - iconSpace: 0, - cols: 2, - colGap: 32, - charsPerNumber: 2, - delimiter: ":" -} - -export String itemMenuHeadline "Please choose an item." -export MenuProperties itemMenuPrototype { - font: normalFont, - disabledFont: disabledFont, - cursor: handCursor, - charsPerEntry: 15, - rows: 6, - rowGap: 8, - iconSpace: 16, - cols: 1, - colGap: 32, - charsPerNumber: 2, - delimiter: ":" -} - -export String ikariMenuHeadline "Please choose equipment." -export MenuProperties ikariMenuPrototype { - font: normalFont, +export BattleResources battleResources { + swapCursor: Sprite { + image: :"swap-cursor.png", + size: <32,32> + }, + attackIcons: Sprite { + image: :"attack-type-icons.png", + size: <32,32> + }, + attackChoiceIcons: Sprite { + image: :"attack-choice-icons.png", + size: <16,16> + }, + moveIcons: Sprite { + image: :"move-icons.png", + size: <32,32> + }, + + titleFrame: Frame { + image: :"title-frame.png", + border: <16,16> + }, + titleFont: Font { + sprite: Sprite { + image: :"large-font.png", + size: <16,32> + }, + rowoffset: -2 + }, + + numberAnimationPrototype: ComplexAnimation { + frametime: frameTime, + repeat: false, + frames: [ + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0,-26> }, + { column: 0, row: 0, disposition: < 0,-42> }, + { column: 0, row: 0, disposition: < 0,-48> }, + { column: 0, row: 0, disposition: < 0,-42> }, + { column: 0, row: 0, disposition: < 0,-26> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0,-12> }, + { column: 0, row: 0, disposition: < 0,-20> }, + { column: 0, row: 0, disposition: < 0,-24> }, + { column: 0, row: 0, disposition: < 0,-20> }, + { column: 0, row: 0, disposition: < 0,-12> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, -6> }, + { column: 0, row: 0, disposition: < 0,-10> }, + { column: 0, row: 0, disposition: < 0,-12> }, + { column: 0, row: 0, disposition: < 0,-10> }, + { column: 0, row: 0, disposition: < 0, -6> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0, 0> }, + { column: 0, row: 0, disposition: < 0,-36> }, + { column: 0, row: 0, disposition: < 0,-32> }, + { column: 0, row: 0, disposition: < 0,-18> } + ] + }, + bigNumberSprite: Sprite { + image: :"big-numbers.png", + size: <16,32> + }, + greenNumberSprite: Sprite { + image: :"big-green-numbers.png", + size: <16,32> + }, + + heroTagLabels: Sprite { + image: :"hero-tag-sprites.png", + size: <32,16> + }, + levelLabelCol: 0, + levelLabelRow: 0, + healthLabelCol: 0, + healthLabelRow: 1, + manaLabelCol: 0, + manaLabelRow: 2, + moveLabelCol: 0, + moveLabelRow: 3, + ikariLabelCol: 0, + ikariLabelRow: 4, + heroTagFont: Font { + sprite: Sprite { + image: :"numbers.png", + size: <16,16> + }, + rowoffset: -3 + }, + + activeHeroTagFrame: Frame { + image: :"tag-frames.png", + border: <16,16> + }, + heroTagFrame: Frame { + image: :"tag-frames.png", + border: <16,16>, + offset: < 0,33> + }, + + smallHeroTagFrame: Frame { + image: :"small-tag-frame.png", + border: <8,16> + }, + lastSmallHeroTagFrame: Frame { + image: :"small-tag-frame.png", + border: <8,16>, + offset: <0,33> + }, + heroesBgColor: (24, 40, 49), + + healthGauge: Gauge { + image: :"gauges.png", + full: <0,16>, + empty: <0, 0>, + height: 16, + start: 6, + repeat: 1, + end: 6 + }, + manaGauge: Gauge { + image: :"gauges.png", + full: <0,32>, + empty: <0, 0>, + height: 16, + start: 6, + repeat: 1, + end: 6 + }, + ikariGauge: Gauge { + image: :"gauges.png", + full: <0,48>, + empty: <0, 0>, + height: 16, + start: 6, + repeat: 1, + end: 6 + }, + + selectFrame: Frame { + image: :"select-frame.png", + border: <16,16> + }, + normalFont: normalFont, disabledFont: disabledFont, - cursor: handCursor, - charsPerEntry: 12, - rows: 6, - rowGap: 8, - iconSpace: 16, - cols: 1, - colGap: 32, - charsPerAdditionalText: 12, - additionalTextGap: 16 -} -export String noEquipmentText "No equip" - -export String escapeText "Escapes." + menuCursor: Sprite { + image: :"cursor-hand.png", + size: <32,32> + }, + + weaponTargetCursor: Sprite { + image: :"targeting-icons.png", + size: <32,32> + }, + magicTargetCursor: Sprite { + image: :"targeting-icons.png", + size: <32,32>, + offset: <0,32> + }, + itemTargetCursor: Sprite { + image: :"targeting-icons.png", + size: <32,32>, + offset: <0,64> + }, + + weaponMenuIcon: swordIcon, + armorMenuIcon: armorIcon, + shieldMenuIcon: shieldIcon, + helmetMenuIcon: helmetIcon, + ringMenuIcon: ringIcon, + jewelMenuIcon: jewelIcon, + + spellMenuHeadline: "Please choose a spell.", + spellMenuProperties: MenuProperties { + font: normalFont, + disabledFont: disabledFont, + cursor: handCursor, + charsPerEntry: 9, + rows: 6, + rowGap: 8, + iconSpace: 0, + cols: 2, + colGap: 32, + charsPerNumber: 2, + delimiter: ":" + }, + + itemMenuHeadline: "Please choose an item.", + itemMenuProperties: MenuProperties { + font: normalFont, + disabledFont: disabledFont, + cursor: handCursor, + charsPerEntry: 15, + rows: 6, + rowGap: 8, + iconSpace: 16, + cols: 1, + colGap: 32, + charsPerNumber: 2, + delimiter: ":" + }, + + ikariMenuHeadline: "Please choose equipment.", + ikariMenuProperties: MenuProperties { + font: normalFont, + disabledFont: disabledFont, + cursor: handCursor, + charsPerEntry: 12, + rows: 6, + rowGap: 8, + iconSpace: 16, + cols: 1, + colGap: 32, + charsPerAdditionalText: 12, + additionalTextGap: 16 + }, + noEquipmentText: "No equip", + + escapeText: "Escapes." +} \ No newline at end of file