summaryrefslogtreecommitdiff
path: root/src/gui/item_amount.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-19 21:59:59 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-19 21:59:59 +0100
commit3fcd3755f5c5d23af31e081c59275ef94cb4e036 (patch)
treed0c8e5f9d733bc68bcdd157eaad1efa5925bfac3 /src/gui/item_amount.cpp
parent59cf6979f8e0a86deb0975ef135593b207ffe34a (diff)
downloadmana-client-3fcd3755f5c5d23af31e081c59275ef94cb4e036.tar.gz
mana-client-3fcd3755f5c5d23af31e081c59275ef94cb4e036.tar.bz2
mana-client-3fcd3755f5c5d23af31e081c59275ef94cb4e036.tar.xz
mana-client-3fcd3755f5c5d23af31e081c59275ef94cb4e036.zip
Fixes to the NPC Integer input field
Also don't set "The Mana World" to start with. Signed-off-by: Ira Rice <irarice@gmail.com> (cherry picked from Aethyra commit d2b804c1a817ccdd85b4b1220bf929e9d370d774) Conflicts: src/game.cpp src/gui/inttextfield.cpp src/gui/item_amount.cpp src/gui/textfield.h
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r--src/gui/item_amount.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index 17c3243a..cd6c6937 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -22,7 +22,7 @@
#include "item_amount.h"
#include "button.h"
-#include "inttextbox.h"
+#include "inttextfield.h"
#include "slider.h"
#include "trade.h"
@@ -40,11 +40,11 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
const int maxRange = mItem->getQuantity();
// Integer field
- mItemAmountTextBox = new IntTextBox(1);
- mItemAmountTextBox->setRange(1, maxRange);
- mItemAmountTextBox->setWidth(30);
- mItemAmountTextBox->setActionEventId("Dummy");
- mItemAmountTextBox->addActionListener(this);
+ mItemAmountTextField = new IntTextField(1);
+ mItemAmountTextField->setRange(1, maxRange);
+ mItemAmountTextField->setWidth(30);
+ mItemAmountTextField->setActionEventId("Dummy");
+ mItemAmountTextField->addActionListener(this);
// Slider
mItemAmountSlide = new Slider(1.0, maxRange);
@@ -62,7 +62,7 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
// Set positions
place(0, 0, minusButton);
- place(1, 0, mItemAmountTextBox).setPadding(2);
+ place(1, 0, mItemAmountTextField).setPadding(2);
place(2, 0, plusButton);
place(0, 1, mItemAmountSlide, 6);
place(4, 2, okButton);
@@ -90,12 +90,12 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item):
void ItemAmountWindow::resetAmount()
{
- mItemAmountTextBox->setInt(1);
+ mItemAmountTextField->setValue(1);
}
void ItemAmountWindow::action(const gcn::ActionEvent &event)
{
- int amount = mItemAmountTextBox->getInt();
+ int amount = mItemAmountTextField->getValue();
if (event.getId() == "Cancel")
{
@@ -115,14 +115,14 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
}
else if (event.getId() == "Drop")
{
- player_node->dropItem(mItem, mItemAmountTextBox->getInt());
+ player_node->dropItem(mItem, mItemAmountTextField->getValue());
scheduleDelete();
}
else if (event.getId() == "AddTrade")
{
- tradeWindow->tradeItem(mItem, mItemAmountTextBox->getInt());
+ tradeWindow->tradeItem(mItem, mItemAmountTextField->getValue());
scheduleDelete();
}
- mItemAmountTextBox->setInt(amount);
+ mItemAmountTextField->setValue(amount);
mItemAmountSlide->setValue(amount);
}