]> git.localhorst.tv Git - l2e.git/blob - CapsuleMenu.h
6358a6a269a2d986a09dae61a6a60c6bfdf895ce
[l2e.git] / CapsuleMenu.h
1 #ifndef MENU_CAPSULEMENU_H_
2 #define MENU_CAPSULEMENU_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 CapsuleMenu
13 : public app::State {
14
15 public:
16         explicit CapsuleMenu(PartyMenu *parent);
17
18 public:
19         virtual void HandleEvents(const app::Input &);
20         virtual void UpdateWorld(float deltaT);
21         virtual void Render(SDL_Surface *);
22
23         void RenderBackground(SDL_Surface *screen) const;
24         void RenderCapsule(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
25         void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
26         void RenderWheel(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
27         void RenderStats(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
28         void RenderStatsLine(SDL_Surface *screen, const geometry::Vector<int> &offset, const char *name, int value) const;
29         void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
30
31 public:
32         common::GameConfig &Game();
33         const common::GameConfig &Game() const;
34         Resources &Res();
35         const Resources &Res() const;
36         common::Capsule &GetCapsule();
37         const common::Capsule &GetCapsule() const;
38
39         int Width() const;
40         int Height() const;
41
42 private:
43         virtual void OnEnterState(SDL_Surface *screen);
44         virtual void OnExitState(SDL_Surface *screen);
45         virtual void OnResumeState(SDL_Surface *screen);
46         virtual void OnPauseState(SDL_Surface *screen);
47
48         virtual void OnResize(int width, int height);
49
50 private:
51         PartyMenu *parent;
52         enum Choice {
53                 CHOICE_FEED,
54                 CHOICE_CHANGE,
55                 CHOICE_NAME,
56         };
57         graphics::Menu<Choice> menu;
58
59 };
60
61 }
62
63 #endif /* MENU_CAPSULEMENU_H_ */