summaryrefslogtreecommitdiff
path: root/src/gui/tradewindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-22 18:51:17 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-22 18:51:17 +0300
commit668306a14e6ecfc6ce9b283b10f9f59cdab788a0 (patch)
treef49e003b8374ccc9be9e8c6bf6d8d20638bcd593 /src/gui/tradewindow.cpp
parent699d7c41c4f2904d96b69315c28372b71d22b5e9 (diff)
downloadmv-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.gz
mv-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.bz2
mv-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.xz
mv-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.zip
Fixed money cheat hightlight in trade fix. Was broken some time and color was not changed.
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"),