]> git.localhorst.tv Git - l2e.git/commitdiff
activated shoulder buttons in equip menu
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 29 Nov 2012 12:02:10 +0000 (13:02 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 29 Nov 2012 12:02:10 +0000 (13:02 +0100)
src/menu/EquipMenu.cpp

index 0caff55467b5779a00f72b559d647c6e80cf16d5..b917c9a3308525b5b389a74bf1b190cf3fa039a3 100644 (file)
@@ -72,6 +72,12 @@ void EquipMenu::OnResize(int width, int height) {
 
 
 void EquipMenu::HandleEvents(const Input &input) {
+       if (input.JustPressed(Input::SHOULDER_LEFT)) {
+               PreviousHero();
+       }
+       if (input.JustPressed(Input::SHOULDER_RIGHT)) {
+               NextHero();
+       }
        if (actionMenu.IsActive()) {
                if (input.JustPressed(Input::PAD_UP)) {
                        actionMenu.PreviousRow();
@@ -87,7 +93,7 @@ void EquipMenu::HandleEvents(const Input &input) {
                                        equipmentMenu.SetActive();
                                        break;
                                case CHOICE_STRONGEST:
-                                       // TODO
+                                       // TODO: implement "equip strongest" when items' stat effects are done
                                        break;
                                case CHOICE_REMOVE:
                                        actionMenu.SetSelected();
@@ -264,11 +270,17 @@ void EquipMenu::RenderInventoryMenu(SDL_Surface *screen, const Vector<int> &offs
 void EquipMenu::NextHero() {
        cursor = (cursor + 1) % parent->Game().state->partySize;
        LoadEquipment();
+       if (InventoryVisible()) {
+               LoadInventory();
+       }
 }
 
 void EquipMenu::PreviousHero() {
        cursor = (cursor + parent->Game().state->partySize - 1) % parent->Game().state->partySize;
        LoadEquipment();
+       if (InventoryVisible()) {
+               LoadInventory();
+       }
 }
 
 Hero &EquipMenu::GetHero() {