summaryrefslogtreecommitdiff
path: root/src/gui/sell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r--src/gui/sell.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index b0957f9e..c9878c84 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -87,8 +87,8 @@ SellDialog::SellDialog():
quitButton->setPosition(208, 186);
- mShopItemList->setEventId("item");
- mSlider->setEventId("mSlider");
+ mShopItemList->setActionEventId("item");
+ mSlider->setActionEventId("mSlider");
mShopItemList->setPriceCheck(false);
@@ -154,11 +154,11 @@ void SellDialog::addItem(Item *item, int price)
mShopItemList->adjustSize();
}
-void SellDialog::action(const std::string &eventId, gcn::Widget *widget)
+void SellDialog::action(const gcn::ActionEvent &event)
{
int selectedItem = mShopItemList->getSelected();
- if (eventId == "item")
+ if (event.getId() == "item")
{
mAmountItems = 0;
mSlider->setValue(0);
@@ -182,7 +182,7 @@ void SellDialog::action(const std::string &eventId, gcn::Widget *widget)
}
mQuantityLabel->adjustSize();
}
- else if (eventId == "quit")
+ else if (event.getId() == "quit")
{
setVisible(false);
current_npc = 0;
@@ -195,13 +195,13 @@ void SellDialog::action(const std::string &eventId, gcn::Widget *widget)
bool updateButtonsAndLabels = false;
- if (eventId == "mSlider")
+ if (event.getId() == "mSlider")
{
mAmountItems = (int)(mSlider->getValue() * mMaxItems);
updateButtonsAndLabels = true;
}
- else if (eventId == "+")
+ else if (event.getId() == "+")
{
assert(mAmountItems < mMaxItems);
mAmountItems++;
@@ -209,7 +209,7 @@ void SellDialog::action(const std::string &eventId, gcn::Widget *widget)
updateButtonsAndLabels = true;
}
- else if (eventId == "-")
+ else if (event.getId() == "-")
{
assert(mAmountItems > 0);
mAmountItems--;
@@ -218,7 +218,7 @@ void SellDialog::action(const std::string &eventId, gcn::Widget *widget)
updateButtonsAndLabels = true;
}
- else if (eventId == "sell")
+ else if (event.getId() == "sell")
{
// Attempt sell
assert(mAmountItems > 0 && mAmountItems <= mMaxItems);