X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;h=07b7770859c1bfbb0812f810178f44534b9db0a3;hb=bdebc167119794e59c26a058d1155a337b1bc768;hp=79b2be06d7dc436c27d9be5d264ef77a639fad86;hpb=243cb7d922fe888be8d18241de138ad5949de430;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 79b2be0..07b7770 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -7,6 +7,8 @@ #include "PartyMenu.h" +#include "ChangeHero.h" +#include "InventoryMenu.h" #include "Resources.h" #include "SelectHero.h" #include "StatusMenu.h" @@ -29,7 +31,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,6 +95,7 @@ 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: break; @@ -101,9 +104,10 @@ void PartyMenu::HandleEvents(const Input &input) { case MENU_ITEM_EQUIP: 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 +200,10 @@ const Resources &PartyMenu::Res() const { return *game->menuResources; } -void PartyMenu::OnStatusSelect(PartyMenu *self, int index) { - self->Ctrl().ChangeState(new StatusMenu(self, index)); +void PartyMenu::OnStatusSelect(void *ref, int index) { + PartyMenu *self(reinterpret_cast(ref)); + self->Ctrl().ChangeState( + new StatusMenu(self, index)); } }