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