summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-11 14:46:33 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-11 14:46:33 +0000
commitdf55cebf829f1d75e8354646d53c842f4468aa56 (patch)
tree35dd7a7e10593b0c270c226729d5e6fa719c93e7
parent840ad21b50930cfc18f321dce58234aaa9d216a0 (diff)
downloadmana-client-df55cebf829f1d75e8354646d53c842f4468aa56.tar.gz
mana-client-df55cebf829f1d75e8354646d53c842f4468aa56.tar.bz2
mana-client-df55cebf829f1d75e8354646d53c842f4468aa56.tar.xz
mana-client-df55cebf829f1d75e8354646d53c842f4468aa56.zip
Moved check on dropping 1 item to the inventory dialog.
-rw-r--r--ChangeLog8
-rw-r--r--src/gui/inventorywindow.cpp9
-rw-r--r--src/gui/item_amount.cpp8
-rw-r--r--src/gui/item_amount.h2
4 files changed, 15 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a738e0f..c3433e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2007-11-09 Philipp Sehmisch <tmw@crushnet.org>
+2007-11-11 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/gui/item_amount.cpp, src/gui/item_amount.h,
+ src/gui/inventorywindow.cpp: Moved check on dropping 1 item to the
+ inventory dialog.
+
+2007-11-09 Philipp Sehmisch <tmw@crushnet.org>
* data/graphics/sprites/chest-chainmail-male,
data/graphics/sprites/chest-chainmail-female,
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 35cdde93..7b888212 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -122,8 +122,13 @@ void InventoryWindow::action(const gcn::ActionEvent &event)
}
else if (event.getId() == "drop")
{
- // Choose amount of items to drop
- new ItemAmountWindow(AMOUNT_ITEM_DROP, this, item);
+ if (item->getQuantity() == 1) {
+ player_node->dropItem(item, 1);
+ }
+ else {
+ // Choose amount of items to drop
+ new ItemAmountWindow(AMOUNT_ITEM_DROP, this, item);
+ }
}
}
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index 801a9ce8..f72462f9 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -35,14 +35,6 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
Window("Select amount of items to drop.", true, parent),
mItem(item)
{
- //when there is only one item on the stack skip the dialog
- if (mItem->getQuantity() == 1)
- {
- player_node->dropItem(mItem, 1);
- scheduleDelete();
- return;
- };
-
// New labels
mItemAmountTextBox = new IntTextBox(1);
diff --git a/src/gui/item_amount.h b/src/gui/item_amount.h
index 01319012..67002703 100644
--- a/src/gui/item_amount.h
+++ b/src/gui/item_amount.h
@@ -39,7 +39,7 @@ class Item;
#define AMOUNT_ITEM_DROP 2
/**
- * Window used for selecting the amount of items to drop.
+ * Window used for selecting the amount of items to drop or trade.
*
* \ingroup Interface
*/