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