#include "PartyMenu.h"
+#include "ChangeHero.h"
+#include "ConfigMenu.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"
: 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<int>(0, 0);
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:
+ Ctrl().PushState(new ConfigMenu(this));
break;
case MENU_ITEM_SCENARIO:
break;
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<PartyMenu *>(ref));
+ self->Ctrl().ChangeState(
+ new EquipMenu(self, index));
+}
+
+void PartyMenu::OnSpellSelect(void *ref, int index) {
+ PartyMenu *self(reinterpret_cast<PartyMenu *>(ref));
+ self->Ctrl().ChangeState(
+ new SpellMenu(self, index));
+}
+
+void PartyMenu::OnStatusSelect(void *ref, int index) {
+ PartyMenu *self(reinterpret_cast<PartyMenu *>(ref));
+ self->Ctrl().ChangeState(
+ new StatusMenu(self, index));
}
}