]> git.localhorst.tv Git - l2e.git/blob - src/menu/CapsuleNameMenu.h
4630c0acf4f6fde4527fda449a9e53f100c8276e
[l2e.git] / src / menu / CapsuleNameMenu.h
1 #ifndef MENU_CAPSULENAMEMENU_H_
2 #define MENU_CAPSULENAMEMENU_H_
3
4 #include "fwd.h"
5 #include "../app/State.h"
6 #include "../common/fwd.h"
7 #include "../math/Vector.h"
8 #include "../graphics/CharSelect.h"
9
10 namespace menu {
11
12 class CapsuleMenu;
13
14 class CapsuleNameMenu
15 : public app::State {
16
17 public:
18         explicit CapsuleNameMenu(CapsuleMenu *parent);
19
20 public:
21         virtual void HandleEvents(const app::Input &);
22         virtual void UpdateWorld(Uint32 deltaT);
23         virtual void Render(SDL_Surface *);
24
25 public:
26         int Width() const;
27         int Height() const;
28
29 private:
30         virtual void OnEnterState(SDL_Surface *screen);
31         virtual void OnExitState(SDL_Surface *screen);
32         virtual void OnResumeState(SDL_Surface *screen);
33         virtual void OnPauseState(SDL_Surface *screen);
34
35         virtual void OnResize(int width, int height);
36
37         common::Capsule &GetCapsule();
38         const common::Capsule &GetCapsule() const;
39
40         void AddChar();
41         void RemoveChar();
42         void StoreName();
43
44         void RenderName(SDL_Surface *screen, const math::Vector<int> &offset) const;
45         void RenderAlphabet(SDL_Surface *screen, const math::Vector<int> &offset) const;
46
47 private:
48         CapsuleMenu *parent;
49         graphics::CharSelect select;
50         int cursor;
51         char buffer[6];
52         bool first;
53
54 };
55
56 }
57
58 #endif /* MENU_CAPSULENAMEMENU_H_ */