X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=20a2a8ee567dd74b37734699f1577a71d42ca6d9;hb=d71217e2be1466726581146000a0f61620423e9b;hp=e605c193255a4b92ac92255b5fb5deadac9b1e44;hpb=17afcc24569b38a9816f616bc025ba871ad3e48e;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index e605c19..20a2a8e 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -1,15 +1,13 @@ -/* - * PartyMenu.cpp - * - * Created on: Oct 21, 2012 - * Author: holy - */ - #include "PartyMenu.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" #include "../app/Application.h" #include "../app/Input.h" @@ -94,12 +92,15 @@ void PartyMenu::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_A)) { switch (mainMenu.Selected()) { case MENU_ITEM_ITEM: + Ctrl().PushState(new InventoryMenu(this)); break; case MENU_ITEM_SPELL: + Ctrl().PushState(new SelectHero(this, this, this, OnSpellSelect)); break; case MENU_ITEM_CAPSULE: 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)); @@ -108,8 +109,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; @@ -198,6 +201,18 @@ const Resources &PartyMenu::Res() const { return *game->menuResources; } +void PartyMenu::OnEquipSelect(void *ref, int index) { + PartyMenu *self(reinterpret_cast(ref)); + self->Ctrl().ChangeState( + new EquipMenu(self, index)); +} + +void PartyMenu::OnSpellSelect(void *ref, int index) { + PartyMenu *self(reinterpret_cast(ref)); + self->Ctrl().ChangeState( + new SpellMenu(self, index)); +} + void PartyMenu::OnStatusSelect(void *ref, int index) { PartyMenu *self(reinterpret_cast(ref)); self->Ctrl().ChangeState(