summaryrefslogtreecommitdiff
path: root/src/gui/windows/shopwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-27 16:26:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-27 16:26:21 +0300
commit32947c0634ec582f6d641402433d2037f5087a36 (patch)
tree776923ebcb5f52f663a622bac8b578d20833c511 /src/gui/windows/shopwindow.cpp
parent8b1e42a9e0d311d9c393ebceef1d508cbc8ad324 (diff)
downloadplus-32947c0634ec582f6d641402433d2037f5087a36.tar.gz
plus-32947c0634ec582f6d641402433d2037f5087a36.tar.bz2
plus-32947c0634ec582f6d641402433d2037f5087a36.tar.xz
plus-32947c0634ec582f6d641402433d2037f5087a36.zip
Fix compilation with eathena only.
Diffstat (limited to 'src/gui/windows/shopwindow.cpp')
-rw-r--r--src/gui/windows/shopwindow.cpp72
1 files changed, 38 insertions, 34 deletions
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index e10197537..4cb922519 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -231,6 +231,7 @@ void ShopWindow::action(const ActionEvent &event)
close();
return;
}
+#ifdef TMWA_SUPPORT
else if (eventId == "yes")
{
startTrade();
@@ -244,6 +245,19 @@ void ShopWindow::action(const ActionEvent &event)
player_relations.ignoreTrade(mTradeNick);
mTradeNick.clear();
}
+ else if (eventId == "announce")
+ {
+ if (isBuySelected)
+ {
+ if (mBuyShopItems && mBuyShopItems->getNumberOfElements() > 0)
+ announce(mBuyShopItems, BUY);
+ }
+ else if (mSellShopItems && mSellShopItems->getNumberOfElements() > 0)
+ {
+ announce(mSellShopItems, SELL);
+ }
+ }
+#endif
else if (eventId == "delete")
{
if (isBuySelected)
@@ -263,18 +277,6 @@ void ShopWindow::action(const ActionEvent &event)
localPlayer->updateStatus();
}
}
- else if (eventId == "announce")
- {
- if (isBuySelected)
- {
- if (mBuyShopItems && mBuyShopItems->getNumberOfElements() > 0)
- announce(mBuyShopItems, BUY);
- }
- else if (mSellShopItems && mSellShopItems->getNumberOfElements() > 0)
- {
- announce(mSellShopItems, SELL);
- }
- }
else if (eventId == "tab_buy")
{
isBuySelected = true;
@@ -387,28 +389,6 @@ void ShopWindow::action(const ActionEvent &event)
}
}
-void ShopWindow::startTrade()
-{
- if (!actorManager || !tradeWindow)
- return;
-
- const Being *const being = actorManager->findBeingByName(
- mTradeNick, ActorType::Player);
- tradeWindow->clear();
- if (mTradeMoney)
- {
- tradeWindow->addAutoMoney(mTradeNick, mTradeMoney);
- }
- else
- {
- tradeWindow->addAutoItem(mTradeNick, mTradeItem,
- mTradeItem->getQuantity());
- }
- tradeHandler->request(being);
- tradePartnerName = mTradeNick;
- mTradeNick.clear();
-}
-
void ShopWindow::valueChanged(const SelectionEvent &event A_UNUSED)
{
updateButtonsAndLabels();
@@ -629,6 +609,7 @@ void ShopWindow::saveList() const
shopFile.close();
}
+#ifdef TMWA_SUPPORT
void ShopWindow::announce(ShopItems *const list, const int mode)
{
if (!list)
@@ -688,6 +669,28 @@ void ShopWindow::announce(ShopItems *const list, const int mode)
chatHandler->channelMessage(TRADE_CHANNEL, data);
}
+void ShopWindow::startTrade()
+{
+ if (!actorManager || !tradeWindow)
+ return;
+
+ const Being *const being = actorManager->findBeingByName(
+ mTradeNick, ActorType::Player);
+ tradeWindow->clear();
+ if (mTradeMoney)
+ {
+ tradeWindow->addAutoMoney(mTradeNick, mTradeMoney);
+ }
+ else
+ {
+ tradeWindow->addAutoItem(mTradeNick, mTradeItem,
+ mTradeItem->getQuantity());
+ }
+ tradeHandler->request(being);
+ tradePartnerName = mTradeNick;
+ mTradeNick.clear();
+}
+
void ShopWindow::giveList(const std::string &nick, const int mode)
{
if (!checkFloodCounter(mLastRequestTimeList))
@@ -1001,6 +1004,7 @@ bool ShopWindow::findShopItem(const ShopItem *const shopItem,
}
return false;
}
+#endif
int ShopWindow::sumAmount(const Item *const shopItem)
{