diff options
author | Reid <reidyaro@gmail.com> | 2012-01-30 15:27:30 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-01-30 15:27:30 +0100 |
commit | 502a0a0163e702af7334979a2eabfc4826a94091 (patch) | |
tree | 5e80ef76585b1718d7e74a411117c725fe3cb0e9 /src/gui/shopwindow.cpp | |
parent | 8dea62750ab3a44e0f35f2543bbb6ccf2a9470ce (diff) | |
parent | 193ea898e5f549c14c0e4cd0d060785de4fb4bcf (diff) | |
download | plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.gz plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.bz2 plus-502a0a0163e702af7334979a2eabfc4826a94091.tar.xz plus-502a0a0163e702af7334979a2eabfc4826a94091.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/gui/shopwindow.cpp')
-rw-r--r-- | src/gui/shopwindow.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index b6b87edb7..1a27b8b0c 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -55,6 +55,7 @@ #include "net/net.h" #include "net/chathandler.h" #include "net/npchandler.h" +#include "net/playerhandler.h" #include "net/tradehandler.h" #include "resources/iteminfo.h" @@ -206,11 +207,15 @@ void ShopWindow::action(const gcn::ActionEvent &event) && mBuyShopItemList->getSelected() >= 0) { mBuyShopItems->del(mBuyShopItemList->getSelected()); + if (isShopEmpty() && player_node) + player_node->updateStatus(); } else if (event.getId() == "delete sell" && mSellShopItemList && mSellShopItemList->getSelected() >= 0) { mSellShopItems->del(mSellShopItemList->getSelected()); + if (isShopEmpty() && player_node) + player_node->updateStatus(); } else if (event.getId() == "announce buy" && mBuyShopItems && mBuyShopItems->getNumberOfElements() > 0) @@ -306,8 +311,12 @@ void ShopWindow::addBuyItem(Item *item, int amount, int price) { if (!mBuyShopItems || !item) return; + bool emp = isShopEmpty(); mBuyShopItems->addItemNoDup(item->getId(), item->getColor(), amount, price); + if (emp && player_node) + player_node->updateStatus(); + updateButtonsAndLabels(); } @@ -315,8 +324,12 @@ void ShopWindow::addSellItem(Item *item, int amount, int price) { if (!mBuyShopItems || !item) return; + bool emp = isShopEmpty(); mSellShopItems->addItemNoDup(item->getId(), item->getColor(), amount, price); + if (emp && player_node) + player_node->updateStatus(); + updateButtonsAndLabels(); } |