]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/PartyMenu.cpp
started implementation of equipment menu
[l2e.git] / src / menu / PartyMenu.cpp
index 07b7770859c1bfbb0812f810178f44534b9db0a3..bda633129211b3973d5e1d33034f6691c8d5efbd 100644 (file)
@@ -8,9 +8,11 @@
 #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"
@@ -98,10 +100,12 @@ void PartyMenu::HandleEvents(const Input &input) {
                                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));
@@ -200,6 +204,18 @@ const Resources &PartyMenu::Res() const {
        return *game->menuResources;
 }
 
+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(