diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-25 17:46:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-25 17:46:25 +0300 |
commit | 76d29de34885538c1e906d9756e677d668d49fe0 (patch) | |
tree | de29b0607bf2bb1dfb2e3bf0e14e7f4b6f79797d | |
parent | 1298d827ce0d1e8bf4c470d6cf8177e0b2035385 (diff) | |
download | plus-76d29de34885538c1e906d9756e677d668d49fe0.tar.gz plus-76d29de34885538c1e906d9756e677d668d49fe0.tar.bz2 plus-76d29de34885538c1e906d9756e677d668d49fe0.tar.xz plus-76d29de34885538c1e906d9756e677d668d49fe0.zip |
Mark some methongs in BuyDialog for tmwa only.
-rw-r--r-- | src/gui/windows/buydialog.cpp | 17 | ||||
-rw-r--r-- | src/gui/windows/buydialog.h | 4 |
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, |