]> git.localhorst.tv Git - l2e.git/blob - src/menu/EquipMenu.h
removed lazy fwd headers
[l2e.git] / src / menu / EquipMenu.h
1 #ifndef MENU_EQUIPMENU_H_
2 #define MENU_EQUIPMENU_H_
3
4 namespace common {
5         class Hero;
6         class Item;
7 }
8 namespace math {
9         template<class>
10         class Vector;
11 }
12 namespace menu {
13         class PartyMenu;
14 }
15
16 #include "../app/State.h"
17 #include "../graphics/Menu.h"
18
19 namespace menu {
20
21 class EquipMenu
22 : public app::State {
23
24 public:
25         EquipMenu(PartyMenu *parent, int heroIndex);
26
27 public:
28         virtual void HandleEvents(const app::Input &);
29         virtual void UpdateWorld(Uint32 deltaT);
30         virtual void Render(SDL_Surface *);
31
32 public:
33         int Width() const;
34         int Height() const;
35
36 private:
37         virtual void OnEnterState(SDL_Surface *screen);
38         virtual void OnExitState(SDL_Surface *screen);
39         virtual void OnResumeState(SDL_Surface *screen);
40         virtual void OnPauseState(SDL_Surface *screen);
41
42         virtual void OnResize(int width, int height);
43
44         void NextHero();
45         void PreviousHero();
46
47         common::Hero &GetHero();
48         const common::Hero &GetHero() const;
49
50         void LoadEquipment();
51         void RemoveAllEquipment();
52         void RemoveItem();
53         void DropItem();
54
55         bool InventoryVisible() const;
56         void LoadInventory();
57         void EquipSelected();
58
59         void RenderStatus(SDL_Surface *screen, const math::Vector<int> &offset) const;
60         void RenderStats(SDL_Surface *screen, const math::Vector<int> &offset) const;
61         void RenderStatsLine(const char *label, int number, SDL_Surface *screen, const math::Vector<int> &position) const;
62         void RenderEquipmentMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
63         void RenderActionMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
64         void RenderInventoryMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
65
66 private:
67         PartyMenu *parent;
68         int cursor;
69         enum Choice {
70                 CHOICE_EQUIP,
71                 CHOICE_STRONGEST,
72                 CHOICE_REMOVE,
73                 CHOICE_REMOVE_ALL,
74                 CHOICE_DROP,
75         };
76         graphics::Menu<Choice> actionMenu;
77         graphics::Menu<const common::Item *> equipmentMenu;
78         graphics::Menu<const common::Item *> inventoryMenu;
79
80 };
81
82 }
83
84 #endif /* MENU_EQUIPMENU_H_ */