]> git.localhorst.tv Git - l2e.git/blob - src/menu/SpellMenu.h
8ad86f398625bd82f2be951a39e5bf44cd1ae36f
[l2e.git] / src / menu / SpellMenu.h
1 #ifndef MENU_SPELLMENU_H_
2 #define MENU_SPELLMENU_H_
3
4 namespace common {
5         class Hero;
6         class Spell;
7 }
8 namespace math {
9         template<class>
10         class Vector;
11 }
12 namespace menu {
13         class PartyMenu;
14 }
15
16 #include "../app/State.h"
17 #include "../graphics/Menu.h"
18
19 namespace menu {
20
21 class SpellMenu
22 : public app::State {
23
24 public:
25         SpellMenu(PartyMenu *parent, int heroIndex);
26
27 public:
28         virtual void HandleEvents(const app::Input &);
29         virtual void UpdateWorld(Uint32 deltaT);
30         virtual void Render(SDL_Surface *);
31
32 public:
33         int Width() const;
34         int Height() const;
35
36 private:
37         virtual void OnEnterState(SDL_Surface *screen);
38         virtual void OnExitState(SDL_Surface *screen);
39         virtual void OnResumeState(SDL_Surface *screen);
40         virtual void OnPauseState(SDL_Surface *screen);
41
42         virtual void OnResize(int width, int height);
43
44         common::Hero &GetHero();
45         const common::Hero &GetHero() const;
46
47         void LoadSpells();
48
49         void RenderHighlight(SDL_Surface *screen, const math::Vector<int> &offset) const;
50         void RenderMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
51         void RenderSpells(SDL_Surface *screen, const math::Vector<int> &offset) const;
52
53 private:
54         PartyMenu *parent;
55         SDL_Surface *highlight;
56         int cursor;
57         enum Choice {
58                 CHOICE_USE,
59                 CHOICE_SORT,
60         };
61         graphics::Menu<Choice> actionMenu;
62         graphics::Menu<const common::Spell *> spellMenu;
63
64 };
65
66 }
67
68 #endif /* MENU_SPELLMENU_H_ */