X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=f3176b3f70981aa4fe66c942b3d4ea4bd9d6aa8c;hb=10a8d3a83e7ad6815bc9f752922239ef32073a5e;hp=993fad5abc00f0293175ffc635213461da0b79a6;hpb=670dd3c61cba875345b6755d41f479cff8d964c4;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 993fad5..f3176b3 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -1,15 +1,12 @@ -/* - * PartyMenu.cpp - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #include "PartyMenu.h" +#include "CapsuleMenu.h" #include "ChangeHero.h" +#include "ConfigMenu.h" +#include "EquipMenu.h" #include "InventoryMenu.h" #include "Resources.h" +#include "ScenarioMenu.h" #include "SelectHero.h" #include "SpellMenu.h" #include "StatusMenu.h" @@ -44,7 +41,7 @@ PartyMenu::PartyMenu(GameConfig *game) mainMenu.Add(Res().mainMenuStatusText, 4); mainMenu.Add(Res().mainMenuSpellText, 1); mainMenu.Add(Res().mainMenuChangeText, 5); - mainMenu.Add(Res().mainMenuCapsuleText, 2); + mainMenu.Add(Res().mainMenuCapsuleText, 2, game->state->capsule); mainMenu.Add(Res().mainMenuConfigText, 6); mainMenu.Add(Res().mainMenuEquipmentText, 3); mainMenu.Add(Res().mainMenuScenarioText, 7); @@ -102,8 +99,14 @@ void PartyMenu::HandleEvents(const Input &input) { Ctrl().PushState(new SelectHero(this, this, this, OnSpellSelect)); break; case MENU_ITEM_CAPSULE: + if (game->state->capsule) { + Ctrl().PushState(new CapsuleMenu(this)); + } else { + // noise and blur + } break; case MENU_ITEM_EQUIP: + Ctrl().PushState(new SelectHero(this, this, this, OnEquipSelect)); break; case MENU_ITEM_STATUS: Ctrl().PushState(new SelectHero(this, this, this, OnStatusSelect)); @@ -112,8 +115,10 @@ void PartyMenu::HandleEvents(const Input &input) { Ctrl().PushState(new ChangeHero(this)); break; case MENU_ITEM_CONFIG: + Ctrl().PushState(new ConfigMenu(this)); break; case MENU_ITEM_SCENARIO: + Ctrl().PushState(new ScenarioMenu(this)); break; default: break; @@ -202,10 +207,10 @@ const Resources &PartyMenu::Res() const { return *game->menuResources; } -void PartyMenu::OnStatusSelect(void *ref, int index) { +void PartyMenu::OnEquipSelect(void *ref, int index) { PartyMenu *self(reinterpret_cast(ref)); self->Ctrl().ChangeState( - new StatusMenu(self, index)); + new EquipMenu(self, index)); } void PartyMenu::OnSpellSelect(void *ref, int index) { @@ -214,4 +219,10 @@ void PartyMenu::OnSpellSelect(void *ref, int index) { new SpellMenu(self, index)); } +void PartyMenu::OnStatusSelect(void *ref, int index) { + PartyMenu *self(reinterpret_cast(ref)); + self->Ctrl().ChangeState( + new StatusMenu(self, index)); +} + }