diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-02-13 18:33:04 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-02-13 18:33:04 +0200 |
commit | 3aba05585b85989b5d0927939812f612c3b0d4d9 (patch) | |
tree | ff6ecef24d5bad6ced0112c8d81ea5c185c5f914 /src/gui/statuswindow.cpp | |
parent | 15b8c6e64326caf9cea7e948f48cf487cef625b5 (diff) | |
download | manaverse-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.gz manaverse-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.bz2 manaverse-3aba05585b85989b5d0927939812f612c3b0d4d9.tar.xz manaverse-3aba05585b85989b5d0927939812f612c3b0d4d9.zip |
Add money bar.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r-- | src/gui/statuswindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 30fec8773..ffc00db5a 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -548,6 +548,25 @@ void StatusWindow::updateWeightBar(ProgressBar *bar) } } +void StatusWindow::updateMoneyBar(ProgressBar *bar) +{ + if (!bar) + return; + + int money = PlayerInfo::getAttribute(MONEY); + bar->setText(Units::formatCurrency(money).c_str()); + if (money > 0) + { + float progress = static_cast<float>(money) + / static_cast<float>(1000000000); + bar->setProgress(progress); + } + else + { + bar->setProgress(1.0); + } +} + void StatusWindow::updateInvSlotsBar(ProgressBar *bar) { Inventory *inv = PlayerInfo::getInventory(); |