diff options
Diffstat (limited to 'src/client/inventory.h')
-rw-r--r-- | src/client/inventory.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/client/inventory.h b/src/client/inventory.h new file mode 100644 index 0000000..f66ec56 --- /dev/null +++ b/src/client/inventory.h @@ -0,0 +1,57 @@ +/* + client/inventory.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_CLIENT_INVENTORY_H__ +#define __INCLUDED_CLIENT_INVENTORY_H__ + +#include "core/info.h" +#include "core/inventory.h" +#include "ui/listview.h" +#include "ui/plaintext.h" +#include "ui/window.h" + +namespace client { + +/** + * @brief an inventory window widget + */ +class Inventory : public ui::Window +{ +public: + Inventory(ui::Widget *parent = 0); + ~Inventory(); + + void toggle(); +protected: + /// resize event handler + virtual void resize(); + + /// draw event handler + virtual void draw(); + + /// emit event handler + virtual bool on_emit(Widget *sender, const Event event, void *data); + + /// keypress event handler + virtual bool on_keypress(const int key, const unsigned int modifier); + +private: + void update_inventory(); + + void update_selection(); + + bool verify() const; + + unsigned long menu_inventorytimestamp; + unsigned long menu_infotimestamp; + ui::ListView *menu_listview; + ui::Label *menu_namelabel; + ui::PlainText *menu_inventorytext; + +}; // class Inventory + +} +#endif // __INCLUDED_CLIENT_INVENTORY_H__ |