From c2f007b58743491dc9250f09137ad847043b840d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Feb 2015 00:14:39 +0300 Subject: eathena: impliment packet SMSG_BUYINGSTORE_OWN_ITEMS. --- src/gui/windows/shopwindow.cpp | 11 +++++++++++ src/gui/windows/shopwindow.h | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'src/gui/windows') diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 6490ff746..bed828f0a 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -88,6 +88,7 @@ ShopWindow::ShopWindow() : SelectionListener(), VendingModeListener(), VendingSlotsListener(), + BuyingStoreModeListener(), BuyingStoreSlotsListener(), // TRANSLATORS: shop window button mCloseButton(new Button(this, _("Close"), "close", this)), @@ -121,6 +122,7 @@ ShopWindow::ShopWindow() : mBuyShopSize(0), isBuySelected(true), mHaveVending(serverFeatures->haveVending()), + mEnableBuyingStore(false), mEnableVending(false) { mBuyShopItemList->postInit(); @@ -1063,3 +1065,12 @@ void ShopWindow::buyingStoreSlotsChanged(const int slots) mBuyShopSize = slots; updateButtonsAndLabels(); } + +void ShopWindow::buyingStoreEnabled(const bool b) +{ + mEnableBuyingStore = b; + localPlayer->enableShop(b); + if (!b) + mBuyShopSize = 0; + updateButtonsAndLabels(); +} diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h index e3398d093..313d3b4fb 100644 --- a/src/gui/windows/shopwindow.h +++ b/src/gui/windows/shopwindow.h @@ -26,6 +26,7 @@ #include "gui/widgets/window.h" #include "listeners/actionlistener.h" +#include "listeners/buyingstoremodelistener.h" #include "listeners/buyingstoreslotslistener.h" #include "listeners/selectionlistener.h" #include "listeners/vendingmodelistener.h" @@ -50,6 +51,7 @@ class ShopWindow final : public Window, public SelectionListener, public VendingModeListener, public VendingSlotsListener, + public BuyingStoreModeListener, public BuyingStoreSlotsListener { public: @@ -149,6 +151,8 @@ class ShopWindow final : public Window, void vendingEnabled(const bool b) override final; + void buyingStoreEnabled(const bool b) override final; + void setShopName(const std::string &name); private: @@ -191,6 +195,7 @@ class ShopWindow final : public Window, int mBuyShopSize; bool isBuySelected; bool mHaveVending; + bool mEnableBuyingStore; bool mEnableVending; }; -- cgit v1.2.3-60-g2f50