summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-15 22:01:00 -0700
committerIra Rice <irarice@gmail.com>2009-01-15 22:01:00 -0700
commit600e10515e127d6393f0756cb72e5a63303557a2 (patch)
tree19afc618315e59e09355241ca2b8ae850dc89e6a /src/gui/itemcontainer.h
parent0a18932056e2a72f41cdd14c831344ad80cfb35b (diff)
downloadmana-600e10515e127d6393f0756cb72e5a63303557a2.tar.gz
mana-600e10515e127d6393f0756cb72e5a63303557a2.tar.bz2
mana-600e10515e127d6393f0756cb72e5a63303557a2.tar.xz
mana-600e10515e127d6393f0756cb72e5a63303557a2.zip
Integrated the ItemPopup class from Legends of Mazzeroth.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/itemcontainer.h')
-rw-r--r--src/gui/itemcontainer.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index 8927b001..223a3677 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -28,6 +28,8 @@
#include <guichan/widget.hpp>
#include <guichan/widgetlistener.hpp>
+#include "itempopup.h"
+
#include "../guichanfwd.h"
class Image;
@@ -107,6 +109,9 @@ class ItemContainer : public gcn::Widget,
}
private:
+ void mouseExited(gcn::MouseEvent &event);
+ void mouseMoved(gcn::MouseEvent &event);
+
/**
* Sets the currently selected item. Invalid (e.g., negative) indices set `no item'.
@@ -128,6 +133,15 @@ class ItemContainer : public gcn::Widget,
*/
void distributeValueChangedEvent(void);
+ /**
+ * Gets the slot index based on the cursor position.
+ *
+ * @param posX The X Coordinate position.
+ * @param posY The Y Coordinate position.
+ * @return The slot index on success, -1 on failure.
+ */
+ int getSlotIndex(const int posX, const int posY) const;
+
Inventory *mInventory;
Image *mSelImg;
int mSelectedItemIndex;
@@ -136,6 +150,8 @@ class ItemContainer : public gcn::Widget,
int mMaxItems;
int mOffset;
+ ItemPopup *mItemPopup;
+
std::list<gcn::SelectionListener*> mListeners;
static const int gridWidth;