From a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 28 Jan 2012 21:00:12 +0300 Subject: Add support for processing player statuses in evol server. --- src/gui/shopwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/shopwindow.cpp') 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(); } -- cgit v1.2.3-70-g09d2