X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectMoveAction.cpp;h=b2cac81e7357330918b501ee75dcf056d5b82d0d;hb=0542849dfccfec1ce1477265fa0fee2401a8fb23;hp=de8e97b4db066fca0b316cfcc767094470f8bc89;hpb=62c0a1d0ac98eb51418e4daa59e80b6cc97b522f;p=l2e.git diff --git a/src/battle/states/SelectMoveAction.cpp b/src/battle/states/SelectMoveAction.cpp index de8e97b..b2cac81 100644 --- a/src/battle/states/SelectMoveAction.cpp +++ b/src/battle/states/SelectMoveAction.cpp @@ -7,17 +7,16 @@ #include "SelectMoveAction.h" +#include "RunState.h" #include "SelectAttackType.h" #include "SwapHeroes.h" #include "../BattleState.h" #include "../MoveMenu.h" #include "../../app/Application.h" #include "../../app/Input.h" -#include "../../geometry/operators.h" using app::Application; using app::Input; -using geometry::Point; using geometry::Vector; namespace battle { @@ -44,7 +43,7 @@ void SelectMoveAction::Resize(int width, int height) { } -void SelectMoveAction::HandleInput(const Input &input) { +void SelectMoveAction::HandleEvents(const Input &input) { if (input.IsDown(Input::PAD_UP)) { battle->GetMoveMenu().Select(MoveMenu::CHANGE); } else if (input.IsDown(Input::PAD_DOWN)) { @@ -63,7 +62,7 @@ void SelectMoveAction::HandleInput(const Input &input) { ctrl->PushState(new SwapHeroes(battle, this)); break; case MoveMenu::RUN: - // TODO: switch to run state + ctrl->ChangeState(new RunState(battle)); break; } } @@ -82,9 +81,9 @@ void SelectMoveAction::Render(SDL_Surface *screen) { } void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector &offset) { - Point position( - (battle->BackgroundWidth() - battle->GetMoveMenu().Width()) / 2, - battle->BackgroundHeight() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2); + Vector position( + (battle->Width() - battle->GetMoveMenu().Width()) / 2, + battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2); battle->GetMoveMenu().Render(screen, position + offset); }