summaryrefslogtreecommitdiff
path: root/src/gui/tradewindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/tradewindow.cpp')
-rw-r--r--src/gui/tradewindow.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp
index 279f6c178..58ac9c592 100644
--- a/src/gui/tradewindow.cpp
+++ b/src/gui/tradewindow.cpp
@@ -65,6 +65,7 @@ TradeWindow::TradeWindow():
mAutoAddItem(0),
mAutoAddToNick(""),
mGotMoney(0),
+ mGotMaxMoney(0),
mAutoMoney(0)
{
logger->log1("TradeWindow::TradeWindow nick");
@@ -141,9 +142,15 @@ TradeWindow::~TradeWindow()
void TradeWindow::setMoney(int amount)
{
- if (amount < mGotMoney)
+ if (amount < 0 || amount < mGotMaxMoney)
+ {
mMoneyLabel->setForegroundColor(Theme::getThemeColor(Theme::WARNING));
- mMoneyLabel->setForegroundColor(Theme::getThemeColor(Theme::TEXT));
+ }
+ else
+ {
+ mMoneyLabel->setForegroundColor(Theme::getThemeColor(Theme::TEXT));
+ mGotMaxMoney = amount;
+ }
mGotMoney = amount;
mMoneyLabel->setCaption(strprintf(_("You get %s"),