From: Daniel Karbach Date: Thu, 29 Nov 2012 12:02:10 +0000 (+0100) Subject: activated shoulder buttons in equip menu X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=12e95869c947badeb84f0a80b58cce26e67e1ad5;p=l2e.git activated shoulder buttons in equip menu --- diff --git a/src/menu/EquipMenu.cpp b/src/menu/EquipMenu.cpp index 0caff55..b917c9a 100644 --- a/src/menu/EquipMenu.cpp +++ b/src/menu/EquipMenu.cpp @@ -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 &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() {