X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmenu%2FSpellMenu.cpp;h=0c7936595bd2e44525b3ad97c6ca7535619b3008;hb=69c74684a16695cc068824129ef82ea37f1b4511;hp=3be722bffa550313b9005d408a166268bb68b329;hpb=6a954cc1f6324d61282e21ec0d7dee6e6265f44f;p=l2e.git diff --git a/src/menu/SpellMenu.cpp b/src/menu/SpellMenu.cpp index 3be722b..0c79365 100644 --- a/src/menu/SpellMenu.cpp +++ b/src/menu/SpellMenu.cpp @@ -1,15 +1,9 @@ -/* - * SpellMenu.cpp - * - * Created on: Nov 18, 2012 - * Author: holy - */ - #include "SpellMenu.h" #include "HeroStatus.h" #include "PartyMenu.h" #include "Resources.h" +#include "../app/Application.h" #include "../app/Input.h" #include "../common/GameConfig.h" #include "../common/GameState.h" @@ -17,6 +11,7 @@ #include "../common/Spell.h" #include "../graphics/Font.h" #include "../graphics/Frame.h" +#include "../math/Vector.h" #include #include @@ -25,7 +20,7 @@ using app::Input; using common::Hero; using common::Spell; -using geometry::Vector; +using math::Vector; using graphics::Font; using graphics::Frame; using std::vector; @@ -50,7 +45,9 @@ void SpellMenu::OnEnterState(SDL_Surface *) { SDL_SetAlpha(highlight, SDL_SRCALPHA|SDL_RLEACCEL, 0x20); actionMenu.SetSelected(); + actionMenu.StartAnimation(Ctrl()); LoadSpells(); + spellMenu.StartAnimation(Ctrl()); } void SpellMenu::LoadSpells() { @@ -132,7 +129,8 @@ void SpellMenu::HandleEvents(const Input &input) { // TODO: use spell } } else { - // TODO: swap spells + std::swap(GetHero().Spells().at(spellMenu.SelectedIndex()), + GetHero().Spells().at(spellMenu.SecondaryIndex())); spellMenu.SwapSelected(); spellMenu.SetActive(); } @@ -150,7 +148,7 @@ void SpellMenu::HandleEvents(const Input &input) { } } -void SpellMenu::UpdateWorld(float deltaT) { +void SpellMenu::UpdateWorld(Uint32 deltaT) { }