diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-22 18:51:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-22 18:51:17 +0300 |
commit | 668306a14e6ecfc6ce9b283b10f9f59cdab788a0 (patch) | |
tree | f49e003b8374ccc9be9e8c6bf6d8d20638bcd593 /src/gui | |
parent | 699d7c41c4f2904d96b69315c28372b71d22b5e9 (diff) | |
download | manaverse-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.gz manaverse-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.bz2 manaverse-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.xz manaverse-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.zip |
Fixed money cheat hightlight in trade fix. Was broken some time and color was not changed.
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; }; |