From 79e803232438d41cce80467a97e9efde8e6c0c70 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 15 Feb 2009 11:29:40 +0000 Subject: Add configurable units system --- src/gui/buy.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gui/buy.cpp') diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 0c8c4d9d..23bf89f5 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -31,6 +31,7 @@ #include "widgets/layout.h" #include "../npc.h" +#include "../units.h" #include "../net/messageout.h" #include "../net/protocol.h" @@ -54,7 +55,8 @@ BuyDialog::BuyDialog(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); mBuyButton = new Button(_("Buy"), "buy", this); @@ -235,5 +237,7 @@ void BuyDialog::updateButtonsAndLabels() // Update quantity and money labels mQuantityLabel->setCaption(strprintf("%d / %d", mAmountItems, mMaxItems)); mMoneyLabel->setCaption - (strprintf(_("Price: %d GP / Total: %d GP"), price, mMoney - price)); + (strprintf(_("Price: %s / Total: %s"), + Units::formatCurrency(price).c_str(), + Units::formatCurrency(mMoney - price).c_str())); } -- cgit v1.2.3-70-g09d2