]> git.localhorst.tv Git - l2e.git/blob - src/menu/PartyMenu.h
added 'change' menu state
[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         int Width() const;
39         int Height() const;
40
41 public:
42         void RenderBackground(SDL_Surface *screen) const;
43         void RenderHeros(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
44         void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
45         void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
46
47         geometry::Vector<int> StatusOffset(int index) const;
48         const HeroStatus &GetHeroStatus(int index) const { return status[index]; }
49
50         static void OnStatusSelect(void *, int);
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         enum MenuItem {
62                 MENU_ITEM_ITEM,
63                 MENU_ITEM_SPELL,
64                 MENU_ITEM_CAPSULE,
65                 MENU_ITEM_EQUIP,
66                 MENU_ITEM_STATUS,
67                 MENU_ITEM_CHANGE,
68                 MENU_ITEM_CONFIG,
69                 MENU_ITEM_SCENARIO,
70         };
71
72 private:
73         HeroStatus status[4];
74         geometry::Vector<int> statusPositions[4];
75         common::GameConfig *game;
76         graphics::Menu<int> mainMenu;
77
78 };
79
80 }
81
82 #endif /* MENU_PARTYMENU_H_ */