]> git.localhorst.tv Git - l2e.git/blob - src/menu/InventoryMenu.h
e0cb6feee1ca9463528518689688a6e6cd11bdcc
[l2e.git] / src / menu / InventoryMenu.h
1 #ifndef MENU_INVENTORYMENU_H_
2 #define MENU_INVENTORYMENU_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 InventoryMenu
13 : public app::State {
14
15 public:
16         explicit InventoryMenu(PartyMenu *parent);
17
18 public:
19         virtual void HandleEvents(const app::Input &);
20         virtual void UpdateWorld(float deltaT);
21         virtual void Render(SDL_Surface *);
22
23         int Width() const;
24         int Height() const;
25
26 private:
27         virtual void OnEnterState(SDL_Surface *screen);
28         virtual void OnExitState(SDL_Surface *screen);
29         virtual void OnResumeState(SDL_Surface *screen);
30         virtual void OnPauseState(SDL_Surface *screen);
31
32         virtual void OnResize(int width, int height);
33
34         void LoadInventory();
35
36         void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
37         void RenderInventory(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
38
39 private:
40         PartyMenu *parent;
41         enum Choice {
42                 CHOICE_USE,
43                 CHOICE_SORT,
44                 CHOICE_DROP,
45         };
46         graphics::Menu<Choice> menu;
47         graphics::Menu<const common::Item *> itemMenu;
48
49 };
50
51 }
52
53 #endif /* MENU_INVENTORYMENU_H_ */