]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/SelectSpell.cpp
renamed TargetSelections Enemies to Monsters
[l2e.git] / src / battle / states / SelectSpell.cpp
index 3b4573f485f526f0ad80fcae5cf27d8b5552273e..1bc195c12223e2a7d00b95f642da72ef3a15f19c 100644 (file)
@@ -38,7 +38,7 @@ void SelectSpell::ExitState(Application &c, SDL_Surface *screen) {
 void SelectSpell::ResumeState(Application &ctrl, SDL_Surface *screen) {
        if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) {
                battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::MAGIC);
-               battle->ActiveHero().GetAttackChoice().SetSpell(battle->GetSpellMenu().Selected());
+               battle->ActiveHero().GetAttackChoice().SetSpell(battle->ActiveHero().SpellMenu().Selected());
                ctrl.PopState();
        }
 }
@@ -55,14 +55,14 @@ void SelectSpell::Resize(int width, int height) {
 
 void SelectSpell::HandleEvents(const Input &input) {
        if (input.JustPressed(Input::ACTION_A)) {
-               if (battle->GetSpellMenu().SelectedIsEnabled()) {
+               if (battle->ActiveHero().SpellMenu().SelectedIsEnabled()) {
                        AttackChoice &ac(battle->ActiveHero().GetAttackChoice());
-                       const Spell *spell(battle->GetSpellMenu().Selected());
+                       const Spell *spell(battle->ActiveHero().SpellMenu().Selected());
                        ac.Selection().Reset();
                        if (spell->GetTargetingMode().TargetsAlly()) {
                                ac.Selection().SelectHeroes();
                        } else {
-                               ac.Selection().SelectEnemies();
+                               ac.Selection().SelectMonsters();
                        }
                        if (spell->GetTargetingMode().TargetsAll()) {
                                ac.SetType(AttackChoice::MAGIC);
@@ -84,16 +84,16 @@ void SelectSpell::HandleEvents(const Input &input) {
                ctrl->PopState(); // return control to parent
        }
        if (input.JustPressed(Input::PAD_UP)) {
-               battle->GetSpellMenu().PreviousRow();
+               battle->ActiveHero().SpellMenu().PreviousRow();
        }
        if (input.JustPressed(Input::PAD_RIGHT)) {
-               battle->GetSpellMenu().NextItem();
+               battle->ActiveHero().SpellMenu().NextItem();
        }
        if (input.JustPressed(Input::PAD_DOWN)) {
-               battle->GetSpellMenu().NextRow();
+               battle->ActiveHero().SpellMenu().NextRow();
        }
        if (input.JustPressed(Input::PAD_LEFT)) {
-               battle->GetSpellMenu().PreviousItem();
+               battle->ActiveHero().SpellMenu().PreviousItem();
        }
 }
 
@@ -130,7 +130,7 @@ void SelectSpell::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->GetSpellMenu().Draw(screen, position + offset);
+       battle->ActiveHero().SpellMenu().Draw(screen, position + offset);
 }
 
 }