summaryrefslogtreecommitdiff
path: root/src/gui/windows/shopwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-15 12:25:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-15 12:25:28 +0300
commit5d7a02cee16478f23488495b3d031013eacea108 (patch)
treea1374603b86d38f2a0ada850b69e21a7d7c67f74 /src/gui/windows/shopwindow.cpp
parentc2f007b58743491dc9250f09137ad847043b840d (diff)
downloadplus-5d7a02cee16478f23488495b3d031013eacea108.tar.gz
plus-5d7a02cee16478f23488495b3d031013eacea108.tar.bz2
plus-5d7a02cee16478f23488495b3d031013eacea108.tar.xz
plus-5d7a02cee16478f23488495b3d031013eacea108.zip
allow unpublish buying store shop.
Diffstat (limited to 'src/gui/windows/shopwindow.cpp')
-rw-r--r--src/gui/windows/shopwindow.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index bed828f0a..da8a4e41b 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -286,13 +286,21 @@ void ShopWindow::action(const ActionEvent &event)
{
if (isBuySelected)
{
- std::vector<ShopItem*> &items = mBuyShopItems->items();
- if (!items.empty())
+ if (mEnableBuyingStore)
{
- buyingStoreHandler->create(mSellShopName,
- PlayerInfo::getAttribute(Attributes::MONEY),
- true,
- items);
+ buyingStoreHandler->close();
+ BuyingStoreModeListener::distributeEvent(false);
+ }
+ else
+ {
+ std::vector<ShopItem*> &items = mBuyShopItems->items();
+ if (!items.empty())
+ {
+ buyingStoreHandler->create(mSellShopName,
+ PlayerInfo::getAttribute(Attributes::MONEY),
+ true,
+ items);
+ }
}
}
else
@@ -414,7 +422,10 @@ void ShopWindow::updateButtonsAndLabels()
&& mBuyShopItems->getNumberOfElements() > 0;
if (mPublishButton)
{
- mPublishButton->setCaption(_("Publish"));
+ if (mEnableBuyingStore)
+ mPublishButton->setCaption(_("Unpublish"));
+ else
+ mPublishButton->setCaption(_("Publish"));
mPublishButton->adjustSize();
if (mBuyShopSize > 0)
mPublishButton->setEnabled(true);