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.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index 154d1a57..1aa0e2d3 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +31,7 @@
#include "widgets/layout.h"
#include "../npc.h"
+#include "../units.h"
#include "../net/messageout.h"
#include "../net/protocol.h"
@@ -57,8 +57,8 @@ SellDialog::SellDialog(Network *network):
mScrollArea = new ScrollArea(mShopItemList);
mSlider = new Slider(1.0);
mQuantityLabel = new gcn::Label("0");
- mMoneyLabel = new gcn::Label(
- strprintf(_("Price: %d GP / Total: %d GP"), 0, 0));
+ mMoneyLabel = new gcn::Label(strprintf(_("Price: %s / Total: %s"),
+ "", ""));
mIncreaseButton = new Button("+", "+", this);
mDecreaseButton = new Button("-", "-", this);
mSellButton = new Button(_("Sell"), "sell", this);
@@ -263,7 +263,14 @@ void SellDialog::updateButtonsAndLabels()
// Update the quantity and money labels
mQuantityLabel->setCaption(strprintf("%d / %d", mAmountItems, mMaxItems));
- mMoneyLabel->setCaption
- (strprintf(_("Price: %d GP / Total: %d GP"),
- income, mPlayerMoney + income));
+ mMoneyLabel->setCaption(strprintf(_("Price: %s / Total: %s"),
+ Units::formatCurrency(income).c_str(),
+ Units::formatCurrency(mPlayerMoney + income).c_str()));
+}
+
+void SellDialog::logic()
+{
+ Window::logic();
+
+ if (!current_npc) setVisible(false);
}