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