X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FAttackTypeMenu.cpp;h=2ec7a1f129b26bbe25eadf47232d014023fc8cdd;hb=591ecc2d7ecb0b41144be9b64c09801ac0a28131;hp=b881d8b6f5ee57d5a95e515109bf5e132d9c3148;hpb=010a336797f1419945bed60560cc61fb492793f4;p=l2e.git diff --git a/src/battle/AttackTypeMenu.cpp b/src/battle/AttackTypeMenu.cpp index b881d8b..2ec7a1f 100644 --- a/src/battle/AttackTypeMenu.cpp +++ b/src/battle/AttackTypeMenu.cpp @@ -7,31 +7,15 @@ #include "AttackTypeMenu.h" -#include "../app/Input.h" #include "../geometry/operators.h" #include "../geometry/Vector.h" #include "../graphics/Sprite.h" -using app::Input; using geometry::Point; using geometry::Vector; namespace battle { -void AttackTypeMenu::ReadInput(const Input &input) { - if (input.IsDown(Input::PAD_UP)) { - selected = MAGIC; - } else if (input.IsDown(Input::PAD_RIGHT)) { - selected = DEFEND; - } else if (input.IsDown(Input::PAD_DOWN)) { - selected = IKARI; - } else if (input.IsDown(Input::PAD_LEFT)) { - selected = ITEM; - } else { - selected = SWORD; - } -} - void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Point &position) { Vector swordOffset(IconWidth(), IconHeight()); Vector magicOffset(IconWidth(), 0); @@ -39,11 +23,11 @@ void AttackTypeMenu::Render(SDL_Surface *screen, const geometry::Point &pos Vector ikariOffset(IconWidth(), 2 * IconHeight()); Vector itemOffset(0, IconHeight()); - icons->Draw(screen, position + swordOffset, SWORD, (selected == SWORD) ? 1 : 0); - icons->Draw(screen, position + magicOffset, MAGIC, (selected == MAGIC) ? 1 : 0); - icons->Draw(screen, position + defendOffset, DEFEND, (selected == DEFEND) ? 1 : 0); - icons->Draw(screen, position + ikariOffset, IKARI, (selected == IKARI) ? 1 : 0); - icons->Draw(screen, position + itemOffset, ITEM, (selected == ITEM) ? 1 : 0); + icons->Draw(screen, position + swordOffset, AttackChoice::SWORD, (selected == AttackChoice::SWORD) ? 1 : 0); + icons->Draw(screen, position + magicOffset, AttackChoice::MAGIC, (selected == AttackChoice::MAGIC) ? 1 : 0); + icons->Draw(screen, position + defendOffset, AttackChoice::DEFEND, (selected == AttackChoice::DEFEND) ? 1 : 0); + icons->Draw(screen, position + ikariOffset, AttackChoice::IKARI, (selected == AttackChoice::IKARI) ? 1 : 0); + icons->Draw(screen, position + itemOffset, AttackChoice::ITEM, (selected == AttackChoice::ITEM) ? 1 : 0); } }