X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=bda633129211b3973d5e1d33034f6691c8d5efbd;hb=f2abfc21845c29024ce2478f95429801e91ef8e8;hp=79b2be06d7dc436c27d9be5d264ef77a639fad86;hpb=243cb7d922fe888be8d18241de138ad5949de430;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 79b2be0..bda6331 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -7,8 +7,12 @@ #include "PartyMenu.h" +#include "ChangeHero.h" +#include "EquipMenu.h" +#include "InventoryMenu.h" #include "Resources.h" #include "SelectHero.h" +#include "SpellMenu.h" #include "StatusMenu.h" #include "../app/Application.h" #include "../app/Input.h" @@ -29,7 +33,7 @@ PartyMenu::PartyMenu(GameConfig *game) : game(game) , mainMenu(*game->menuResources->mainMenuProperties) { for (int i(0); i < 4; ++i) { - status[i].SetHero(game->state->party[i]); + status[i].SetHero(game->state->party, i); status[i].SetResources(game->menuResources); } statusPositions[0] = Vector(0, 0); @@ -93,17 +97,21 @@ 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, OnStatusSelect)); + Ctrl().PushState(new SelectHero(this, this, this, OnStatusSelect)); break; case MENU_ITEM_CHANGE: + Ctrl().PushState(new ChangeHero(this)); break; case MENU_ITEM_CONFIG: break; @@ -196,8 +204,22 @@ const Resources &PartyMenu::Res() const { return *game->menuResources; } -void PartyMenu::OnStatusSelect(PartyMenu *self, int index) { - self->Ctrl().ChangeState(new StatusMenu(self, index)); +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( + new StatusMenu(self, index)); } }