summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-16 22:55:47 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-16 22:55:47 +0300
commitf6b355a4237ddcfa49ab07a1083777a9d171675d (patch)
tree4355310ee38c612c89505336b2d278d4d247c3b9
parent319ad7846b8db6194429a6a35103d2ae008218c6 (diff)
downloadmv-f6b355a4237ddcfa49ab07a1083777a9d171675d.tar.gz
mv-f6b355a4237ddcfa49ab07a1083777a9d171675d.tar.bz2
mv-f6b355a4237ddcfa49ab07a1083777a9d171675d.tar.xz
mv-f6b355a4237ddcfa49ab07a1083777a9d171675d.zip
Build vendingmodelistener only if eathena support enabled.
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/Makefile.am4
-rw-r--r--src/gui/windows/shopwindow.cpp20
-rw-r--r--src/gui/windows/shopwindow.h4
-rw-r--r--src/listeners/vendingmodelistener.h3
5 files changed, 19 insertions, 16 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 886cc620e..129945057 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1133,8 +1133,6 @@ SET(SRCS
listeners/updatestatuslistener.h
listeners/uploadlistener.cpp
listeners/uploadlistener.h
- listeners/vendingmodelistener.cpp
- listeners/vendingmodelistener.h
listeners/vendingslotslistener.cpp
listeners/vendingslotslistener.h
utils/sdlpixel.h
@@ -1414,6 +1412,8 @@ SET(SRCS_EATHENA
listeners/pincodelistener.h
listeners/shoprenamelistener.cpp
listeners/shoprenamelistener.h
+ listeners/vendingmodelistener.cpp
+ listeners/vendingmodelistener.h
net/eathena/adminhandler.cpp
net/eathena/adminhandler.h
net/eathena/auctionhandler.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 80c191839..1193acacc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -221,8 +221,6 @@ manaplus_SOURCES += events/actionevent.h \
listeners/updatestatuslistener.h \
listeners/uploadlistener.cpp \
listeners/uploadlistener.h \
- listeners/vendingmodelistener.cpp \
- listeners/vendingmodelistener.h \
listeners/vendingslotslistener.cpp \
listeners/vendingslotslistener.h \
utils/sdlpixel.h \
@@ -1350,6 +1348,8 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \
listeners/pincodelistener.h \
listeners/shoprenamelistener.cpp \
listeners/shoprenamelistener.h \
+ listeners/vendingmodelistener.cpp \
+ listeners/vendingmodelistener.h \
net/eathena/adminhandler.cpp \
net/eathena/adminhandler.h \
net/eathena/auctionhandler.cpp \
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index c4795dd9e..512cb6d54 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -84,9 +84,9 @@ ShopWindow::DialogList ShopWindow::instances;
ShopWindow::ShopWindow() :
// TRANSLATORS: shop window name
Window(_("Personal Shop"), false, nullptr, "shop.xml"),
- VendingModeListener(),
VendingSlotsListener(),
#ifdef EATHENA_SUPPORT
+ VendingModeListener(),
BuyingStoreModeListener(),
BuyingStoreSlotsListener(),
#endif
@@ -1044,15 +1044,6 @@ void ShopWindow::vendingSlotsChanged(const int slots)
updateButtonsAndLabels();
}
-void ShopWindow::vendingEnabled(const bool b)
-{
- mEnableVending = b;
- localPlayer->enableShop(b);
- if (!b)
- mSellShopSize = 0;
- updateButtonsAndLabels();
-}
-
void ShopWindow::updateShopName()
{
if (mSellShopName.empty())
@@ -1075,6 +1066,15 @@ void ShopWindow::setShopName(const std::string &name)
}
#ifdef EATHENA_SUPPORT
+void ShopWindow::vendingEnabled(const bool b)
+{
+ mEnableVending = b;
+ localPlayer->enableShop(b);
+ if (!b)
+ mSellShopSize = 0;
+ updateButtonsAndLabels();
+}
+
void ShopWindow::buyingStoreSlotsChanged(const int slots)
{
mBuyShopSize = slots;
diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h
index 500d67727..3b418a6da 100644
--- a/src/gui/windows/shopwindow.h
+++ b/src/gui/windows/shopwindow.h
@@ -47,9 +47,9 @@ class TabStrip;
* \ingroup Interface
*/
class ShopWindow final : public Window,
- public VendingModeListener,
public VendingSlotsListener,
#ifdef EATHENA_SUPPORT
+ public VendingModeListener,
public BuyingStoreModeListener,
public BuyingStoreSlotsListener,
#endif
@@ -149,9 +149,9 @@ class ShopWindow final : public Window,
void vendingSlotsChanged(const int slots) override final;
+#ifdef EATHENA_SUPPORT
void vendingEnabled(const bool b) override final;
-#ifdef EATHENA_SUPPORT
void buyingStoreEnabled(const bool b) override final;
void buyingStoreSlotsChanged(const int slots) override final;
diff --git a/src/listeners/vendingmodelistener.h b/src/listeners/vendingmodelistener.h
index 2330c3d8d..89b6155b5 100644
--- a/src/listeners/vendingmodelistener.h
+++ b/src/listeners/vendingmodelistener.h
@@ -21,6 +21,8 @@
#ifndef LISTENERS_VENDINGMODELISTENER_H
#define LISTENERS_VENDINGMODELISTENER_H
+#ifdef EATHENA_SUPPORT
+
#include "listeners/baselistener.hpp"
#include "localconsts.h"
@@ -35,4 +37,5 @@ class VendingModeListener notfinal
defineListenerHeader(VendingModeListener)
};
+#endif // EATHENA_SUPPORT
#endif // LISTENERS_VENDINGMODELISTENER_H