summaryrefslogtreecommitdiff
path: root/src/gui/item_amount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r--src/gui/item_amount.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index a8242aae..0f6aa593 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -23,7 +23,9 @@
#include "item_amount.h"
#include "label.h"
#include "slider.h"
+#ifdef EATHENA_SUPPORT
#include "storagewindow.h"
+#endif
#include "trade.h"
#include "widgets/layout.h"
@@ -34,12 +36,16 @@
#include "../utils/gettext.h"
#include "../utils/strprintf.h"
-ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
+ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item,
+ int maxRange):
Window("", true, parent),
mItem(item),
- mMax(item->getQuantity()),
+ mMax(maxRange),
mUsage(usage)
{
+ if (!mMax)
+ mMax = mItem->getQuantity();
+
setCloseButton(true);
// Integer field
@@ -93,6 +99,9 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
case AMOUNT_STORE_REMOVE:
setCaption(_("Select amount of items to retrieve."));
break;
+ case AMOUNT_ITEM_SPLIT:
+ setCaption(_("Select amount of items to split."));
+ break;
default:
break;
}
@@ -139,12 +148,18 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
case AMOUNT_ITEM_DROP:
player_node->dropItem(mItem, amount);
break;
+#ifdef TMWSERV_SUPPORT
+ case AMOUNT_ITEM_SPLIT:
+ player_node->splitItem(mItem, amount);
+ break;
+#else
case AMOUNT_STORE_ADD:
storageWindow->addStore(mItem, amount);
break;
case AMOUNT_STORE_REMOVE:
storageWindow->removeStore(mItem, amount);
break;
+#endif
default:
return;
break;