summaryrefslogtreecommitdiff
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
parent699d7c41c4f2904d96b69315c28372b71d22b5e9 (diff)
downloadplus-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.gz
plus-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.bz2
plus-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.tar.xz
plus-668306a14e6ecfc6ce9b283b10f9f59cdab788a0.zip
Fixed money cheat hightlight in trade fix. Was broken some time and color was not changed.
-rw-r--r--src/gui/tradewindow.cpp11
-rw-r--r--src/gui/tradewindow.h1
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;
};