summaryrefslogtreecommitdiff
path: root/src/gui/item_amount.cpp
diff options
context:
space:
mode:
authorJoshua Langley <joshlangley[at]optusnet.com.au>2007-08-14 09:59:06 +0000
committerJoshua Langley <joshlangley[at]optusnet.com.au>2007-08-14 09:59:06 +0000
commit4eeecc48cbd801ea8038fc1c5325a00d7120d1d7 (patch)
tree9a6a1c43524ffcf59fb55f59f705614bcc2b0a22 /src/gui/item_amount.cpp
parent0601642d8b3aa2c7aa365e27aa3ef2459553c3fd (diff)
downloadmana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.gz
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.bz2
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.tar.xz
mana-client-4eeecc48cbd801ea8038fc1c5325a00d7120d1d7.zip
inventory - split function fix
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r--src/gui/item_amount.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index 22c219f2..33a45fe7 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -33,7 +33,8 @@
#include "../utils/gettext.h"
-ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
+ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item,
+ int maxRange):
Window("", true, parent),
mItem(item)
{
@@ -45,9 +46,12 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
Button *plusButton = new Button("+", "Plus", this);
Button *okButton = new Button(_("Ok"), "Drop", this);
Button *cancelButton = new Button(_("Cancel"), "Cancel", this);
- mItemAmountSlide = new Slider(1.0, mItem->getQuantity());
+ if (!maxRange) {
+ maxRange = mItem->getQuantity();
+ }
+ mItemAmountSlide = new Slider(1.0, maxRange);
- mItemAmountTextBox->setRange(1, mItem->getQuantity());
+ mItemAmountTextBox->setRange(1, maxRange);
mItemAmountSlide->setDimension(gcn::Rectangle(5, 120, 180, 10));
// Set button events Id
@@ -139,4 +143,3 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
mItemAmountTextBox->setInt(amount);
mItemAmountSlide->setValue(amount);
}
-