]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/SelectItem.cpp
removed some outdated TODOs
[l2e.git] / src / battle / states / SelectItem.cpp
index a8c23bb763a9acaf9682dfd841044ae33d3bf8f6..0291b739c9c2746b5b17f6f72edf58fabb203f57 100644 (file)
@@ -35,8 +35,8 @@ void SelectItem::ExitState(Application &c, SDL_Surface *screen) {
 }
 
 void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) {
-       if (battle->ActiveHeroTargets().HasSelected()) {
-               battle->SetAttackType(AttackChoice::ITEM);
+       if (battle->ActiveHeroAttackChoice().Selection().HasSelected()) {
+               battle->ActiveHeroAttackChoice().SetType(AttackChoice::ITEM);
                battle->ActiveHeroAttackChoice().SetItem(battle->GetItemMenu().Selected());
                ctrl.PopState();
        }
@@ -56,25 +56,25 @@ void SelectItem::HandleEvents(const Input &input) {
        if (input.JustPressed(Input::ACTION_A)) {
                if (battle->GetItemMenu().SelectedIsEnabled()) {
                        const Item *item(battle->GetItemMenu().Selected());
-                       battle->ActiveHeroTargets().Reset();
+                       battle->ActiveHeroAttackChoice().Selection().Reset();
                        if (item->GetTargetingMode().TargetsAlly()) {
-                               battle->ActiveHeroTargets().SelectHeroes();
+                               battle->ActiveHeroAttackChoice().Selection().SelectHeroes();
                        } else {
-                               battle->ActiveHeroTargets().SelectEnemies();
+                               battle->ActiveHeroAttackChoice().Selection().SelectEnemies();
                        }
                        if (item->GetTargetingMode().TargetsAll()) {
-                               battle->SetAttackType(AttackChoice::ITEM);
+                               battle->ActiveHeroAttackChoice().SetType(AttackChoice::ITEM);
                                // TODO: remove item from inventory
                                battle->ActiveHeroAttackChoice().SetItem(item);
                                battle->NextHero();
                                ctrl->PopState();
                        } else {
                                if (item->GetTargetingMode().TargetsSingle()) {
-                                       battle->ActiveHeroTargets().SetSingle();
+                                       battle->ActiveHeroAttackChoice().Selection().SetSingle();
                                } else {
-                                       battle->ActiveHeroTargets().SetMultiple();
+                                       battle->ActiveHeroAttackChoice().Selection().SetMultiple();
                                }
-                               ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroTargets(), battle->Res().itemTargetCursor));
+                               ctrl->PushState(new SelectTarget(battle, parent, &battle->ActiveHeroAttackChoice().Selection(), battle->Res().itemTargetCursor));
                        }
                }
        }
@@ -110,7 +110,7 @@ void SelectItem::Render(SDL_Surface *screen) {
 void SelectItem::RenderFrame(SDL_Surface *screen, const Vector<int> &offset) {
        const Frame *frame(battle->Res().selectFrame);
        Point<int> position(frame->BorderWidth(), frame->BorderHeight());
-       int width(battle->BackgroundWidth() - 2 * frame->BorderWidth());
+       int width(battle->Width() - 2 * frame->BorderWidth());
        int height(battle->Res().normalFont->CharHeight() * 13);
        frame->Draw(screen, position + offset, width, height);
 }