From: Daniel Karbach Date: Tue, 21 Aug 2012 19:55:27 +0000 (+0200) Subject: renamed BattleState's GetItemMenu -> ItemMenu X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=f6e55f72530b2d01fbbe8f5745f830d17231c2c4;p=l2e.git renamed BattleState's GetItemMenu -> ItemMenu --- diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 27a3af8..4a07f8e 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -84,8 +84,8 @@ public: AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; } MoveMenu &GetMoveMenu() { return moveMenu; } - graphics::Menu &GetItemMenu() { return itemMenu; } - const graphics::Menu &GetItemMenu() const { return itemMenu; } + graphics::Menu &ItemMenu() { return itemMenu; } + const graphics::Menu &ItemMenu() const { return itemMenu; } void NextHero(); bool BeforeFirstHero() const { return activeHero < 0; } diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index 045f3cc..bd09da6 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -37,7 +37,7 @@ void SelectItem::ExitState(Application &c, SDL_Surface *screen) { void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM); - battle->ActiveHero().GetAttackChoice().SetItem(battle->GetItemMenu().Selected()); + battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected()); ctrl.PopState(); } } @@ -54,9 +54,9 @@ void SelectItem::Resize(int width, int height) { void SelectItem::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_A)) { - if (battle->GetItemMenu().SelectedIsEnabled()) { + if (battle->ItemMenu().SelectedIsEnabled()) { AttackChoice &ac(battle->ActiveHero().GetAttackChoice()); - const Item *item(battle->GetItemMenu().Selected()); + const Item *item(battle->ItemMenu().Selected()); ac.Selection().Reset(); if (item->GetTargetingMode().TargetsAlly()) { ac.Selection().SelectHeroes(); @@ -83,16 +83,16 @@ void SelectItem::HandleEvents(const Input &input) { ctrl->PopState(); // return control to parent } if (input.JustPressed(Input::PAD_UP)) { - battle->GetItemMenu().PreviousRow(); + battle->ItemMenu().PreviousRow(); } if (input.JustPressed(Input::PAD_RIGHT)) { - battle->GetItemMenu().NextItem(); + battle->ItemMenu().NextItem(); } if (input.JustPressed(Input::PAD_DOWN)) { - battle->GetItemMenu().NextRow(); + battle->ItemMenu().NextRow(); } if (input.JustPressed(Input::PAD_LEFT)) { - battle->GetItemMenu().PreviousItem(); + battle->ItemMenu().PreviousItem(); } } @@ -129,7 +129,7 @@ void SelectItem::RenderMenu(SDL_Surface *screen, const Vector &offset) { Point position( 2 * res.selectFrame->BorderWidth() + res.normalFont->CharWidth(), 2 * res.selectFrame->BorderHeight() + 2 * res.normalFont->CharHeight()); - battle->GetItemMenu().Draw(screen, position + offset); + battle->ItemMenu().Draw(screen, position + offset); } }