X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FPartyMenu.cpp;fp=src%2Fmenu%2FPartyMenu.cpp;h=e605c193255a4b92ac92255b5fb5deadac9b1e44;hb=17afcc24569b38a9816f616bc025ba871ad3e48e;hp=79b2be06d7dc436c27d9be5d264ef77a639fad86;hpb=559457f14d914f6b1cb5d588a0ccf97529f011d1;p=l2e.git diff --git a/src/menu/PartyMenu.cpp b/src/menu/PartyMenu.cpp index 79b2be0..e605c19 100644 --- a/src/menu/PartyMenu.cpp +++ b/src/menu/PartyMenu.cpp @@ -7,6 +7,7 @@ #include "PartyMenu.h" +#include "ChangeHero.h" #include "Resources.h" #include "SelectHero.h" #include "StatusMenu.h" @@ -29,7 +30,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); @@ -101,9 +102,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 +198,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)); } }