]> git.localhorst.tv Git - l2e.git/blob - src/menu/PartyMenu.h
added hero selection state + status stub
[l2e.git] / src / menu / PartyMenu.h
1 /*
2  * PartyMenu.h
3  *
4  *  Created on: Oct 21, 2012
5  *      Author: holy
6  */
7
8 #ifndef MENU_PARTYMENU_H_
9 #define MENU_PARTYMENU_H_
10
11 #include "fwd.h"
12 #include "HeroStatus.h"
13 #include "../app/State.h"
14 #include "../common/fwd.h"
15 #include "../geometry/Vector.h"
16 #include "../graphics/Menu.h"
17
18 namespace menu {
19
20 class PartyMenu
21 : public app::State {
22
23 public:
24         explicit PartyMenu(common::GameConfig *);
25         virtual ~PartyMenu();
26
27 public:
28         virtual void HandleEvents(const app::Input &);
29         virtual void UpdateWorld(float deltaT);
30         virtual void Render(SDL_Surface *);
31
32 public:
33         common::GameConfig &Game() { return *game; }
34         const common::GameConfig &Game() const { return *game; }
35         Resources &Res();
36         const Resources &Res() const;
37
38 public:
39         void RenderBackground(SDL_Surface *screen) const;
40         void RenderHeros(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
41         void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
42         void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
43
44         geometry::Vector<int> StatusOffset() const;
45         const HeroStatus &GetHeroStatus(int index) const { return status[index]; }
46
47         static void OnStatusSelect(PartyMenu *, int);
48
49 private:
50         virtual void OnEnterState(SDL_Surface *screen);
51         virtual void OnExitState(SDL_Surface *screen);
52         virtual void OnResumeState(SDL_Surface *screen);
53         virtual void OnPauseState(SDL_Surface *screen);
54
55         virtual void OnResize(int width, int height);
56
57 private:
58         enum MenuItem {
59                 MENU_ITEM_ITEM,
60                 MENU_ITEM_SPELL,
61                 MENU_ITEM_CAPSULE,
62                 MENU_ITEM_EQUIP,
63                 MENU_ITEM_STATUS,
64                 MENU_ITEM_CHANGE,
65                 MENU_ITEM_CONFIG,
66                 MENU_ITEM_SCENARIO,
67         };
68
69 private:
70         HeroStatus status[4];
71         common::GameConfig *game;
72         graphics::Menu<int> mainMenu;
73
74 };
75
76 }
77
78 #endif /* MENU_PARTYMENU_H_ */