summaryrefslogtreecommitdiff
path: root/src/gui/shop.h
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2006-11-05 00:28:55 +0000
committerYohann Ferreira <bertram@cegetel.net>2006-11-05 00:28:55 +0000
commit502af71c74d0b1d5b123d424bc023fcce49916ec (patch)
tree43e6ec1fb1ab283b8cdd7f1c394bcfb7939c1861 /src/gui/shop.h
parent0c85783de45e334f9e116360fec0ae19dccab085 (diff)
downloadmana-client-502af71c74d0b1d5b123d424bc023fcce49916ec.tar.gz
mana-client-502af71c74d0b1d5b123d424bc023fcce49916ec.tar.bz2
mana-client-502af71c74d0b1d5b123d424bc023fcce49916ec.tar.xz
mana-client-502af71c74d0b1d5b123d424bc023fcce49916ec.zip
Added pictures to items in buy dialogs. Also too expensive items are highlighted in gray and can't be selected.
Diffstat (limited to 'src/gui/shop.h')
-rw-r--r--src/gui/shop.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/gui/shop.h b/src/gui/shop.h
index fb1f33fd..0736003b 100644
--- a/src/gui/shop.h
+++ b/src/gui/shop.h
@@ -28,22 +28,34 @@
#include <vector>
#include <guichan/listmodel.hpp>
+#include "../resources/image.h"
struct ITEM_SHOP {
+ short id;
std::string name;
+ Image *image;
int price;
- short id;
int index;
int quantity;
};
-class ShopItems : public std::vector<ITEM_SHOP>, public gcn::ListModel
+class ShopItems : public gcn::ListModel
{
public:
/**
* Destructor
*/
- virtual ~ShopItems() {};
+ ~ShopItems();
+
+ /**
+ * Adds an item and its associated picture
+ */
+ void addItem(short id, int price);
+
+ /**
+ * Convenience function for adding items
+ */
+ void push_back(ITEM_SHOP item_shop);
/**
* Returns the number of items in the shop.
@@ -54,6 +66,20 @@ class ShopItems : public std::vector<ITEM_SHOP>, public gcn::ListModel
* Returns the name of item number i in the shop.
*/
std::string getElementAt(int i);
+
+ /**
+ * Returns the item number i in the shop.
+ */
+ ITEM_SHOP at(int i);
+
+ /**
+ * Clear the vector and delete the pictures' instances.
+ */
+ void clear();
+
+// private: // This is to be readded as soon as the sell dialog is redone.
+ std::vector<ITEM_SHOP> mItemsShop;
+
};
#endif