diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/tradewindow.cpp | 11 | ||||
-rw-r--r-- | src/gui/tradewindow.h | 1 |
2 files changed, 10 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"), diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h index 6865434b6..3c5ed56b0 100644 --- a/src/gui/tradewindow.h +++ b/src/gui/tradewindow.h @@ -163,6 +163,7 @@ class TradeWindow : public Window, gcn::ActionListener, gcn::SelectionListener Item* mAutoAddItem; std::string mAutoAddToNick; int mGotMoney; + int mGotMaxMoney; int mAutoMoney; int mAutoAddAmount; }; |