X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FEquipMenu.cpp;h=1a433beae3d2fb95b24340e495b7828ff340041a;hb=e8283bf94624b2f184d50dc1401bf45225c529d6;hp=0caff55467b5779a00f72b559d647c6e80cf16d5;hpb=0531ef59da95c2b572b8a1bad7b281fbd541f9dc;p=l2e.git diff --git a/src/menu/EquipMenu.cpp b/src/menu/EquipMenu.cpp index 0caff55..1a433be 100644 --- a/src/menu/EquipMenu.cpp +++ b/src/menu/EquipMenu.cpp @@ -1,10 +1,3 @@ -/* - * EquipMenu.cpp - * - * Created on: Nov 18, 2012 - * Author: holy - */ - #include "EquipMenu.h" #include "HeroStatus.h" @@ -20,13 +13,14 @@ #include "../common/Stats.h" #include "../graphics/Font.h" #include "../graphics/Frame.h" +#include "../math/Vector.h" using app::Input; using common::Hero; using common::Inventory; using common::Item; using common::Stats; -using geometry::Vector; +using math::Vector; using graphics::Font; using graphics::Frame; @@ -49,8 +43,11 @@ EquipMenu::EquipMenu(PartyMenu *parent, int cursor) void EquipMenu::OnEnterState(SDL_Surface *) { + actionMenu.StartAnimation(Ctrl()); equipmentMenu.SetInactive(); + equipmentMenu.StartAnimation(Ctrl()); inventoryMenu.SetInactive(); + inventoryMenu.StartAnimation(Ctrl()); } void EquipMenu::OnExitState(SDL_Surface *) { @@ -72,6 +69,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 +90,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(); @@ -158,7 +161,7 @@ void EquipMenu::HandleEvents(const Input &input) { } } -void EquipMenu::UpdateWorld(float deltaT) { +void EquipMenu::UpdateWorld(Uint32 deltaT) { } @@ -264,11 +267,17 @@ void EquipMenu::RenderInventoryMenu(SDL_Surface *screen, const Vector &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() {