X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=22a354e6785b24621d98783496104f4eff440621;hb=a47b25a3a6631c8136fec6585a92b8756c68d243;hp=acdc0ad7e3dd457e2afb7d937079a26f491d9702;hpb=670dd3c61cba875345b6755d41f479cff8d964c4;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index acdc0ad..22a354e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,6 +64,7 @@ using battle::Monster; using battle::PartyLayout; using common::GameConfig; using common::GameState; +using common::Hero; using common::Spell; using geometry::Vector; using graphics::Texture; @@ -236,34 +237,34 @@ int main(int argc, char **argv) { gameState.inventory.Add(caster.GetItem("sleepBallItem"), 1); gameState.inventory.Add(caster.GetItem("zirconPlateItem")); - gameState.heroes[0].SetWeapon(caster.GetItem("zircoSwordItem")); - gameState.heroes[0].SetArmor(caster.GetItem("zirconArmorItem")); - gameState.heroes[0].SetShield(caster.GetItem("holyShieldItem")); - gameState.heroes[0].SetHelmet(caster.GetItem("legendHelmItem")); - gameState.heroes[0].SetRing(caster.GetItem("sProRingItem")); - gameState.heroes[0].SetJewel(caster.GetItem("evilJewelItem")); - -// gameState.heroes[1].SetWeapon(cst.GetItem("zircoWhipItem")); - gameState.heroes[1].SetArmor(caster.GetItem("zirconPlateItem")); - gameState.heroes[1].SetShield(caster.GetItem("zircoGlovesItem")); - gameState.heroes[1].SetHelmet(caster.GetItem("holyCapItem")); - gameState.heroes[1].SetRing(caster.GetItem("ghostRingItem")); - gameState.heroes[1].SetJewel(caster.GetItem("eagleRockItem")); - -// gameState.heroes[2].SetWeapon(cst.GetItem("zircoAxItem")); - gameState.heroes[2].SetArmor(caster.GetItem("zirconArmorItem")); - gameState.heroes[2].SetShield(caster.GetItem("megaShieldItem")); - gameState.heroes[2].SetHelmet(caster.GetItem("zircoHelmetItem")); - gameState.heroes[2].SetRing(caster.GetItem("powerRingItem")); - gameState.heroes[2].SetJewel(caster.GetItem("evilJewelItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_WEAPON, caster.GetItem("zircoSwordItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_ARMOR, caster.GetItem("zirconArmorItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_SHIELD, caster.GetItem("holyShieldItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_HELMET, caster.GetItem("legendHelmItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_RING, caster.GetItem("sProRingItem")); + gameState.heroes[0].SetEquipment(Hero::EQUIP_JEWEL, caster.GetItem("evilJewelItem")); + +// gameState.heroes[1].SetEquipment(Hero::EQUIP_WEAPON, caster.GetItem("zircoWhipItem")); + gameState.heroes[1].SetEquipment(Hero::EQUIP_ARMOR, caster.GetItem("zirconPlateItem")); + gameState.heroes[1].SetEquipment(Hero::EQUIP_SHIELD, caster.GetItem("zircoGlovesItem")); + gameState.heroes[1].SetEquipment(Hero::EQUIP_HELMET, caster.GetItem("holyCapItem")); + gameState.heroes[1].SetEquipment(Hero::EQUIP_RING, caster.GetItem("ghostRingItem")); + gameState.heroes[1].SetEquipment(Hero::EQUIP_JEWEL, caster.GetItem("eagleRockItem")); + +// gameState.heroes[2].SetEquipment(Hero::EQUIP_WEAPON, caster.GetItem("zircoAxItem")); + gameState.heroes[2].SetEquipment(Hero::EQUIP_ARMOR, caster.GetItem("zirconArmorItem")); + gameState.heroes[2].SetEquipment(Hero::EQUIP_SHIELD, caster.GetItem("megaShieldItem")); + gameState.heroes[2].SetEquipment(Hero::EQUIP_HELMET, caster.GetItem("zircoHelmetItem")); + gameState.heroes[2].SetEquipment(Hero::EQUIP_RING, caster.GetItem("powerRingItem")); + gameState.heroes[2].SetEquipment(Hero::EQUIP_JEWEL, caster.GetItem("evilJewelItem")); // NOTE: this is actually Artea equipment -// gameState.heroes[3].SetWeapon(cst.GetItem("lizardBlowItem")); - gameState.heroes[3].SetArmor(caster.GetItem("holyRobeItem")); - gameState.heroes[3].SetShield(caster.GetItem("zircoGlovesItem")); - gameState.heroes[3].SetHelmet(caster.GetItem("holyCapItem")); - gameState.heroes[3].SetRing(caster.GetItem("rocketRingItem")); - gameState.heroes[3].SetJewel(caster.GetItem("krakenRockItem")); +// gameState.heroes[3].SetEquipment(Hero::EQUIP_WEAPON, caster.GetItem("lizardBlowItem")); + gameState.heroes[3].SetEquipment(Hero::EQUIP_ARMOR, caster.GetItem("holyRobeItem")); + gameState.heroes[3].SetEquipment(Hero::EQUIP_SHIELD, caster.GetItem("zircoGlovesItem")); + gameState.heroes[3].SetEquipment(Hero::EQUIP_HELMET, caster.GetItem("holyCapItem")); + gameState.heroes[3].SetEquipment(Hero::EQUIP_RING, caster.GetItem("rocketRingItem")); + gameState.heroes[3].SetEquipment(Hero::EQUIP_JEWEL, caster.GetItem("krakenRockItem")); gameState.heroes[0].MapEntity().Position() = Vector(64, 128); @@ -297,6 +298,8 @@ int main(int argc, char **argv) { graphics::Sprite menuFontSprite(IMG_Load("test-data/menu-font.png"), 16, 16); graphics::Font menuFont(&menuFontSprite, 0, -2); + graphics::Sprite menuInactiveFontSprite(IMG_Load("test-data/menu-font-inactive.png"), 16, 16); + graphics::Font menuInactiveFont(&menuInactiveFontSprite, 0, -2); menuResources.normalFont = &menuFont; @@ -388,8 +391,7 @@ int main(int argc, char **argv) { inventoryMenuProperties.cursor = &menuCursor; inventoryMenuProperties.selectedCursor = &menuActiveCursor; inventoryMenuProperties.font = &menuFont; - // TODO: disabled font - inventoryMenuProperties.disabledFont = &menuFont; + inventoryMenuProperties.disabledFont = &menuInactiveFont; inventoryMenuProperties.iconSpace = 16; inventoryMenuProperties.charsPerNumber = 2; inventoryMenuProperties.delimiter = ':'; @@ -404,13 +406,41 @@ int main(int argc, char **argv) { spellMenuProperties.cursor = &menuCursor; spellMenuProperties.selectedCursor = &menuActiveCursor; spellMenuProperties.font = &menuFont; - // TODO: disabled font - spellMenuProperties.disabledFont = &menuFont; + spellMenuProperties.disabledFont = &menuInactiveFont; spellMenuProperties.iconSpace = 0; spellMenuProperties.charsPerNumber = 2; spellMenuProperties.delimiter = ':'; menuResources.spellMenuProperties = &spellMenuProperties; + graphics::MenuProperties equipmentActionMenuProperties; + equipmentActionMenuProperties.cols = 1; + equipmentActionMenuProperties.rows = 5; + equipmentActionMenuProperties.charsPerEntry = 10; + equipmentActionMenuProperties.rowGap = 8; + equipmentActionMenuProperties.cursor = &menuCursor; + equipmentActionMenuProperties.selectedCursor = &menuActiveCursor; + equipmentActionMenuProperties.font = &menuFont; + equipmentActionMenuProperties.iconSpace = 0; + menuResources.equipmentActionMenuProperties = &equipmentActionMenuProperties; + + graphics::MenuProperties equipmentMenuProperties; + equipmentMenuProperties.cols = 1; + equipmentMenuProperties.rows = 6; + equipmentMenuProperties.charsPerEntry = 12; + equipmentMenuProperties.rowGap = 16; + equipmentMenuProperties.cursor = &menuCursor; + equipmentMenuProperties.selectedCursor = &menuActiveCursor; + equipmentMenuProperties.font = menuResources.statusFont; + equipmentMenuProperties.iconSpace = 16; + equipmentMenuProperties.wrapY = true; + menuResources.equipmentMenuProperties = &equipmentMenuProperties; + + menuResources.equipMenuEquipLabel = "EQUIP"; + menuResources.equipMenuStrongestLabel = "STRONGEST"; + menuResources.equipMenuRemoveLabel = "REMOVE"; + menuResources.equipMenuRemoveAllLabel = "REMOVE ALL"; + menuResources.equipMenuDropLabel = "DROP"; + InitScreen screen(width, height); app::State *state(0);