summaryrefslogtreecommitdiff
path: root/src/gui/itemamount.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-05-05 20:58:21 -0600
committerJared Adams <jaxad0127@gmail.com>2009-05-05 21:00:49 -0600
commitc305c76f82d832cb3db9e1edb805d24522a90c3f (patch)
tree4ee92a92c88ca23ba99c2577d35625e1a24f1466 /src/gui/itemamount.cpp
parent2ab5dd8b3183f228a4f2038d378ad7100ed241a2 (diff)
downloadmana-c305c76f82d832cb3db9e1edb805d24522a90c3f.tar.gz
mana-c305c76f82d832cb3db9e1edb805d24522a90c3f.tar.bz2
mana-c305c76f82d832cb3db9e1edb805d24522a90c3f.tar.xz
mana-c305c76f82d832cb3db9e1edb805d24522a90c3f.zip
Change the item amount window to skip on one item
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r--src/gui/itemamount.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index b3089e34..46d12ee5 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -70,6 +70,14 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item,
minusButton->adjustSize();
minusButton->setWidth(plusButton->getWidth());
+ // If only one item is available, then the window isn't needed, so move on
+ // To prevent problems, we still build the gui elements
+ if (mMax <= 1)
+ {
+ action(gcn::ActionEvent(this, "All"));
+ return;
+ }
+
// Set positions
ContainerPlacer place;
place = getPlacer(0, 0);
@@ -151,14 +159,13 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
case ItemSplit:
player_node->splitItem(mItem, amount);
break;
-#else
+#endif
case StoreAdd:
storageWindow->addStore(mItem, amount);
break;
case StoreRemove:
storageWindow->removeStore(mItem, amount);
break;
-#endif
default:
return;
break;