summaryrefslogtreecommitdiff
path: root/src/dragdrop.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-03 18:41:44 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-03 18:41:44 +0300
commit0b44672a83c505d0e073ba095e2283e60a4016ce (patch)
tree069aaedc8f106b10b5543c7609e7273162a178eb /src/dragdrop.h
parent3e7c8e44bdba6bf7a585bb40e9e75cef81caecb7 (diff)
downloadmanaplus-0b44672a83c505d0e073ba095e2283e60a4016ce.tar.gz
manaplus-0b44672a83c505d0e073ba095e2283e60a4016ce.tar.bz2
manaplus-0b44672a83c505d0e073ba095e2283e60a4016ce.tar.xz
manaplus-0b44672a83c505d0e073ba095e2283e60a4016ce.zip
simplify drag and drop source check.
Diffstat (limited to 'src/dragdrop.h')
-rw-r--r--src/dragdrop.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/dragdrop.h b/src/dragdrop.h
index 3c7167aaf..e58263cc9 100644
--- a/src/dragdrop.h
+++ b/src/dragdrop.h
@@ -207,28 +207,40 @@ class DragDrop
mSelItemColor = 1;
}
- int getSelected()
+ int getSelected() const
{ return mSelItem; }
- int getSelectedColor()
+ int getSelectedColor() const
{ return mSelItemColor; }
- bool isSelected()
+ bool isSelected() const
{ return mSelItem > 0; }
void clearItem(const Item *const item A_UNUSED)
{
}
- const std::string &getText()
+ const std::string &getText() const
{ return mText; }
- int getTag()
+ int getTag() const
{ return mTag; }
void setItem(const int item)
{ mItem = item; }
+ bool isSourceItemContainer() const
+ {
+ return mSource == DRAGDROP_SOURCE_INVENTORY
+ || mSource == DRAGDROP_SOURCE_STORAGE
+ || mSource == DRAGDROP_SOURCE_CART
+ || mSource == DRAGDROP_SOURCE_TRADE
+ || mSource == DRAGDROP_SOURCE_OUTFIT
+ || mSource == DRAGDROP_SOURCE_GROUND
+ || mSource == DRAGDROP_SOURCE_DROP
+ || mSource == DRAGDROP_SOURCE_CRAFT;
+ }
+
private:
int mItem;
uint8_t mItemColor;