summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/windows/buydialog.cpp17
-rw-r--r--src/gui/windows/buydialog.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index 9dc2b8111..45d5f6105 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -208,6 +208,7 @@ BuyDialog::BuyDialog(const BeingId npcId) :
init();
}
+#ifdef TMWA_SUPPORT
BuyDialog::BuyDialog(std::string nick) :
// TRANSLATORS: buy dialog name
Window(_("Buy"), Modal_false, nullptr, "buy.xml"),
@@ -227,6 +228,7 @@ BuyDialog::BuyDialog(std::string nick) :
{
init();
}
+#endif // TMWA_SUPPORT
BuyDialog::BuyDialog(const Being *const being) :
// TRANSLATORS: buy dialog name
@@ -259,8 +261,11 @@ void BuyDialog::init()
setDefaultSize(260, 230, ImagePosition::CENTER);
// reset advance flag for personal shops and cash shop
- if (mAdvanced &&
- (mNpcId == fromInt(Nick, BeingId) || mNpcId == fromInt(Cash, BeingId)))
+ if (mAdvanced && (
+#ifdef TMWA_SUPPORT
+ mNpcId == fromInt(Nick, BeingId) ||
+#endif
+ mNpcId == fromInt(Cash, BeingId)))
{
mAdvanced = false;
}
@@ -459,7 +464,9 @@ void BuyDialog::close()
{
switch (toInt(mNpcId, int))
{
+#ifdef TMWA_SUPPORT
case Nick:
+#endif // TMWA_SUPPORT
case Items:
break;
case Market:
@@ -548,6 +555,7 @@ void BuyDialog::action(const ActionEvent &event)
item->getColor(),
mAmountItems);
}
+#ifdef TMWA_SUPPORT
else if (mNpcId == fromInt(Nick, BeingId))
{
if (tradeWindow)
@@ -558,6 +566,7 @@ void BuyDialog::action(const ActionEvent &event)
item->getPrice() * mAmountItems);
}
}
+#endif // TMWA_SUPPORT
else if (mNpcId == fromInt(Vending, BeingId))
{
item->increaseUsedQuantity(mAmountItems);
@@ -565,7 +574,11 @@ void BuyDialog::action(const ActionEvent &event)
if (mConfirmButton)
mConfirmButton->setEnabled(true);
}
+#ifdef TMWA_SUPPORT
else if (mNpcId != fromInt(Nick, BeingId))
+#else
+ else
+#endif // TMWA_SUPPORT
{
if (mAdvanced)
{
diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h
index fd346f53a..1c6480ec6 100644
--- a/src/gui/windows/buydialog.h
+++ b/src/gui/windows/buydialog.h
@@ -70,12 +70,14 @@ class BuyDialog final : public Window,
*/
explicit BuyDialog(const BeingId npcId);
+#ifdef TMWA_SUPPORT
/**
* Constructor.
*
* @see Window::Window
*/
explicit BuyDialog(std::string nick);
+#endif // TMWA_SUPPORT
/**
* Constructor.
@@ -93,7 +95,9 @@ class BuyDialog final : public Window,
enum
{
+#ifdef TMWA_SUPPORT
Nick = -1,
+#endif // TMWA_SUPPORT
Items = -2,
Market = -3,
Cash = -4,