]> git.localhorst.tv Git - l2e.git/blob - src/menu/CapsuleMenu.h
c42eb4952c3d631e1c8080d21c872315825432af
[l2e.git] / src / menu / CapsuleMenu.h
1 #ifndef MENU_CAPSULEMENU_H_
2 #define MENU_CAPSULEMENU_H_
3
4 namespace common {
5         class Capsule;
6         struct GameConfig;
7 }
8 namespace math {
9         template<class>
10         class Vector;
11 }
12 namespace menu {
13         class PartyMenu;
14         struct Resources;
15 }
16
17 #include "../app/State.h"
18 #include "../graphics/Menu.h"
19
20 namespace menu {
21
22 class CapsuleMenu
23 : public app::State {
24
25 public:
26         explicit CapsuleMenu(PartyMenu *parent);
27
28 public:
29         virtual void HandleEvents(const app::Input &);
30         virtual void UpdateWorld(Uint32 deltaT);
31         virtual void Render(SDL_Surface *);
32
33         void RenderBackground(SDL_Surface *screen) const;
34         void RenderCapsule(SDL_Surface *screen, const math::Vector<int> &offset) const;
35         void RenderInfo(SDL_Surface *screen, const math::Vector<int> &offset) const;
36         void RenderWheel(SDL_Surface *screen, const math::Vector<int> &offset) const;
37         void RenderStats(SDL_Surface *screen, const math::Vector<int> &offset) const;
38         void RenderStatsLine(SDL_Surface *screen, const math::Vector<int> &offset, const char *name, int value) const;
39         void RenderMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
40
41 public:
42         common::GameConfig &Game();
43         const common::GameConfig &Game() const;
44         Resources &Res();
45         const Resources &Res() const;
46         common::Capsule &GetCapsule();
47         const common::Capsule &GetCapsule() const;
48
49         int Width() const;
50         int Height() const;
51
52 private:
53         virtual void OnEnterState(SDL_Surface *screen);
54         virtual void OnExitState(SDL_Surface *screen);
55         virtual void OnResumeState(SDL_Surface *screen);
56         virtual void OnPauseState(SDL_Surface *screen);
57
58         virtual void OnResize(int width, int height);
59
60 private:
61         PartyMenu *parent;
62         enum Choice {
63                 CHOICE_FEED,
64                 CHOICE_CHANGE,
65                 CHOICE_NAME,
66         };
67         graphics::Menu<Choice> menu;
68
69 };
70
71 }
72
73 #endif /* MENU_CAPSULEMENU_H_ */