]> git.localhorst.tv Git - l2e.git/commitdiff
renamed BattleState's GetItemMenu -> ItemMenu
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 21 Aug 2012 19:55:27 +0000 (21:55 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 21 Aug 2012 19:55:27 +0000 (21:55 +0200)
src/battle/BattleState.h
src/battle/states/SelectItem.cpp

index 27a3af8ae396cd7082a3860f10484c821f13cc54..4a07f8e7396ab1fe8c41f2bc0b6e8ac973a39b9b 100644 (file)
@@ -84,8 +84,8 @@ public:
        AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; }
        MoveMenu &GetMoveMenu() { return moveMenu; }
 
-       graphics::Menu<const common::Item *> &GetItemMenu() { return itemMenu; }
-       const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
+       graphics::Menu<const common::Item *> &ItemMenu() { return itemMenu; }
+       const graphics::Menu<const common::Item *> &ItemMenu() const { return itemMenu; }
 
        void NextHero();
        bool BeforeFirstHero() const { return activeHero < 0; }
index 045f3cc6f09e6fc7561b0efa5c8cc7d613cd7284..bd09da664e204891b6a8b3aeeaf86b05e3b174db 100644 (file)
@@ -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<int> &offset) {
        Point<int> 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);
 }
 
 }