summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-16 13:13:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-16 13:13:48 +0300
commit5b8f189276b3883253de31d5e7bbbf897d34c85b (patch)
treec3e6028d800e4caf4acb7ca3f45ba2e63e8df26b /src/gui
parent47d811c90a4655b69f1846c16150efebbfa4ccfa (diff)
downloadmanaplus-5b8f189276b3883253de31d5e7bbbf897d34c85b.tar.gz
manaplus-5b8f189276b3883253de31d5e7bbbf897d34c85b.tar.bz2
manaplus-5b8f189276b3883253de31d5e7bbbf897d34c85b.tar.xz
manaplus-5b8f189276b3883253de31d5e7bbbf897d34c85b.zip
Use guildmanager only if build with tmwa support.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp12
-rw-r--r--src/gui/widgets/tabs/chat/emulateguildtab.h3
-rw-r--r--src/gui/windows/socialwindow.cpp8
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index d596f1a50..9a998214f 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -214,8 +214,10 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
}
else
{
+#ifdef TMWA_SUPPORT
if (guild2->getServerGuild()
|| (guildManager && guildManager->havePower()))
+#endif
{
// TRANSLATORS: popup menu item
// TRANSLATORS: invite player to guild
@@ -492,8 +494,10 @@ void PopupMenu::showPlayerPopup(const std::string &nick)
{
if (guild2->getMember(mNick))
{
+#ifdef TMWA_SUPPORT
if (guild2->getServerGuild() || (guildManager
&& guildManager->havePower()))
+#endif
{
// TRANSLATORS: popup menu item
// TRANSLATORS: kick player from guild
@@ -509,8 +513,10 @@ void PopupMenu::showPlayerPopup(const std::string &nick)
}
else
{
+#ifdef TMWA_SUPPORT
if (guild2->getServerGuild() || (guildManager
&& guildManager->havePower()))
+#endif
{
// TRANSLATORS: popup menu item
// TRANSLATORS: invite player to guild
@@ -811,8 +817,10 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
{
if (guild1->getId() == guild2->getId())
{
+#ifdef TMWA_SUPPORT
if (guild2->getServerGuild() || (guildManager
&& guildManager->havePower()))
+#endif
{
// TRANSLATORS: popup menu item
// TRANSLATORS: kick player from guild
@@ -830,8 +838,10 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
}
else
{
+#ifdef TMWA_SUPPORT
if (guild2->getServerGuild() || (guildManager
&& guildManager->havePower()))
+#endif
{
// TRANSLATORS: popup menu item
// TRANSLATORS: invite player to guild
@@ -1059,8 +1069,10 @@ void PopupMenu::handleLink(const std::string &link,
{
if (guild->getServerGuild())
guildHandler->kick(guild->getMember(mNick), "");
+#ifdef TMWA_SUPPORT
else if (guildManager)
guildManager->kick(mNick);
+#endif
}
}
}
diff --git a/src/gui/widgets/tabs/chat/emulateguildtab.h b/src/gui/widgets/tabs/chat/emulateguildtab.h
index d9cb18a28..8ff759c9c 100644
--- a/src/gui/widgets/tabs/chat/emulateguildtab.h
+++ b/src/gui/widgets/tabs/chat/emulateguildtab.h
@@ -23,6 +23,8 @@
#ifndef GUI_WIDGETS_TABS_CHAT_EMULATEGUILDTAB_H
#define GUI_WIDGETS_TABS_CHAT_EMULATEGUILDTAB_H
+#ifdef TMWA_SUPPORT
+
#include "gui/widgets/tabs/chat/chattab.h"
/**
@@ -53,4 +55,5 @@ class EmulateGuildTab final : public ChatTab,
void getAutoCompleteCommands(StringVect &names) const override final;
};
+#endif // TMWA_SUPPORT
#endif // GUI_WIDGETS_TABS_CHAT_EMULATEGUILDTAB_H
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index d742a0186..b359bc775 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -304,10 +304,14 @@ void SocialWindow::action(const ActionEvent &event)
strprintf(_("Accepted guild invite from %s."),
mPartyInviter.c_str()));
}
+#ifdef TMWA_SUPPORT
if (!guildManager || !GuildManager::getEnableGuildBot())
guildHandler->inviteResponse(mGuildInvited, true);
else
guildManager->inviteResponse(true);
+#else
+ guildHandler->inviteResponse(mGuildInvited, true);
+#endif
}
else if (eventId == "no")
{
@@ -318,10 +322,14 @@ void SocialWindow::action(const ActionEvent &event)
strprintf(_("Rejected guild invite from %s."),
mPartyInviter.c_str()));
}
+#ifdef TMWA_SUPPORT
if (!guildManager || !GuildManager::getEnableGuildBot())
guildHandler->inviteResponse(mGuildInvited, false);
else
guildManager->inviteResponse(false);
+#else
+ guildHandler->inviteResponse(mGuildInvited, false);
+#endif
}
mGuildInvited = 0;