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