]> git.localhorst.tv Git - l2e.git/blob - src/menu/PartyMenu.h
added spell menu dummy
[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         static void OnSpellSelect(void *, int);
52
53 private:
54         virtual void OnEnterState(SDL_Surface *screen);
55         virtual void OnExitState(SDL_Surface *screen);
56         virtual void OnResumeState(SDL_Surface *screen);
57         virtual void OnPauseState(SDL_Surface *screen);
58
59         virtual void OnResize(int width, int height);
60
61 private:
62         enum MenuItem {
63                 MENU_ITEM_ITEM,
64                 MENU_ITEM_SPELL,
65                 MENU_ITEM_CAPSULE,
66                 MENU_ITEM_EQUIP,
67                 MENU_ITEM_STATUS,
68                 MENU_ITEM_CHANGE,
69                 MENU_ITEM_CONFIG,
70                 MENU_ITEM_SCENARIO,
71         };
72
73 private:
74         HeroStatus status[4];
75         geometry::Vector<int> statusPositions[4];
76         common::GameConfig *game;
77         graphics::Menu<int> mainMenu;
78
79 };
80
81 }
82
83 #endif /* MENU_PARTYMENU_H_ */