]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/SelectMoveAction.cpp
added timer facility
[l2e.git] / src / battle / states / SelectMoveAction.cpp
index bee880be88c418135939da8a01c0ee9336eaa792..de8e97b4db066fca0b316cfcc767094470f8bc89 100644 (file)
@@ -8,6 +8,7 @@
 #include "SelectMoveAction.h"
 
 #include "SelectAttackType.h"
+#include "SwapHeroes.h"
 #include "../BattleState.h"
 #include "../MoveMenu.h"
 #include "../../app/Application.h"
@@ -43,7 +44,7 @@ void SelectMoveAction::Resize(int width, int height) {
 }
 
 
-void SelectMoveAction::HandleInput(const app::Input &input) {
+void SelectMoveAction::HandleInput(const Input &input) {
        if (input.IsDown(Input::PAD_UP)) {
                battle->GetMoveMenu().Select(MoveMenu::CHANGE);
        } else if (input.IsDown(Input::PAD_DOWN)) {
@@ -59,7 +60,7 @@ void SelectMoveAction::HandleInput(const app::Input &input) {
                                battle->NextHero();
                                break;
                        case MoveMenu::CHANGE:
-                               // TODO: switch to change state
+                               ctrl->PushState(new SwapHeroes(battle, this));
                                break;
                        case MoveMenu::RUN:
                                // TODO: switch to run state
@@ -83,7 +84,7 @@ void SelectMoveAction::Render(SDL_Surface *screen) {
 void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
        Point<int> position(
                        (battle->BackgroundWidth() - battle->GetMoveMenu().Width()) / 2,
-                       (battle->BackgroundHeight() * 3 / 4) - (battle->GetMoveMenu().Height() / 2));
+                       battle->BackgroundHeight() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
        battle->GetMoveMenu().Render(screen, position + offset);
 }