#include "../graphics/Font.h"
#include "../graphics/Frame.h"
+#include <algorithm>
#include <SDL.h>
#include <vector>
return *parent->Game().state->party[cursor];
}
+Hero &SpellMenu::GetHero() {
+ return *parent->Game().state->party[cursor];
+}
+
void SpellMenu::OnExitState(SDL_Surface *) {
SDL_FreeSurface(highlight);
}
if (input.JustPressed(Input::ACTION_A)) {
if (actionMenu.IsActive()) {
if (actionMenu.Selected() == CHOICE_SORT) {
- // TODO: sort spells
+ std::sort(GetHero().Spells().begin(),
+ GetHero().Spells().end(),
+ Spell::Less);
LoadSpells();
} else {
actionMenu.SetSelected();