]> git.localhorst.tv Git - l2e.git/blob - src/menu/InventoryMenu.h
0668cda1bb7b86c9bc7c648f8438f02886627ec2
[l2e.git] / src / menu / InventoryMenu.h
1 #ifndef MENU_INVENTORYMENU_H_
2 #define MENU_INVENTORYMENU_H_
3
4 namespace common {
5         class Item;
6 }
7 namespace math {
8         template<class>
9         class Vector;
10 }
11 namespace menu {
12         class PartyMenu;
13 }
14
15 #include "../app/State.h"
16 #include "../graphics/Menu.h"
17
18 namespace menu {
19
20 class InventoryMenu
21 : public app::State {
22
23 public:
24         explicit InventoryMenu(PartyMenu *parent);
25
26 public:
27         virtual void HandleEvents(const app::Input &);
28         virtual void UpdateWorld(Uint32 deltaT);
29         virtual void Render(SDL_Surface *);
30
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 LoadInventory();
43
44         void RenderMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
45         void RenderInventory(SDL_Surface *screen, const math::Vector<int> &offset) const;
46
47 private:
48         PartyMenu *parent;
49         enum Choice {
50                 CHOICE_USE,
51                 CHOICE_SORT,
52                 CHOICE_DROP,
53         };
54         graphics::Menu<Choice> menu;
55         graphics::Menu<const common::Item *> itemMenu;
56
57 };
58
59 }
60
61 #endif /* MENU_INVENTORYMENU_H_ */