summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp77
1 files changed, 59 insertions, 18 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 61769bc7e..a3041fcf7 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -27,6 +27,7 @@
#include "being.h"
#include "dropshortcut.h"
#include "guild.h"
+#include "guildmanager.h"
#include "flooritem.h"
#include "graphics.h"
#include "item.h"
@@ -224,14 +225,22 @@ void PopupMenu::showPopup(int x, int y, Being *being)
{
mBrowserBox->addRow(strprintf(
"@@guild-kick|%s@@", _("Kick from guild")));
- mBrowserBox->addRow(strprintf("@@guild-pos|%s >@@",
- _("Change pos in guild")));
+ if (guild2->getServerGuild())
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild-pos|%s >@@",
+ _("Change pos in guild")));
+ }
}
}
else
{
- mBrowserBox->addRow(strprintf(
- "@@guild|%s@@", _("Invite to guild")));
+ if (guild2->getServerGuild()
+ || (guildManager && guildManager->havePower()))
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild|%s@@", _("Invite to guild")));
+ }
}
}
@@ -435,15 +444,26 @@ void PopupMenu::showPlayerPopup(int x, int y, std::string nick)
{
if (guild2->getMember(mNick))
{
- mBrowserBox->addRow(strprintf(
- "@@guild-kick|%s@@", _("Kick from guild")));
- mBrowserBox->addRow(strprintf(
- "@@guild-pos|%s >@@", _("Change pos in guild")));
+ if (guild2->getServerGuild() || (guildManager
+ && guildManager->havePower()))
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild-kick|%s@@", _("Kick from guild")));
+ }
+ if (guild2->getServerGuild())
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild-pos|%s >@@", _("Change pos in guild")));
+ }
}
else
{
- mBrowserBox->addRow(strprintf(
- "@@guild|%s@@", _("Invite to guild")));
+ if (guild2->getServerGuild() || (guildManager
+ && guildManager->havePower()))
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild|%s@@", _("Invite to guild")));
+ }
}
}
@@ -725,16 +745,27 @@ void PopupMenu::showChatPopup(int x, int y, ChatTab *tab)
{
if (guild1->getId() == guild2->getId())
{
- mBrowserBox->addRow(strprintf(
- "@@guild-kick|%s@@", _("Kick from guild")));
- mBrowserBox->addRow(strprintf(
- "@@guild-pos|%s >@@", _("Change pos in guild")));
+ if (guild2->getServerGuild() || (guildManager
+ && guildManager->havePower()))
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild-kick|%s@@", _("Kick from guild")));
+ }
+ if (guild2->getServerGuild())
+ {
+ mBrowserBox->addRow(strprintf("@@guild-pos|%s >@@",
+ _("Change pos in guild")));
+ }
}
}
else
{
- mBrowserBox->addRow(strprintf(
- "@@guild|%s@@", _("Invite to guild")));
+ if (guild2->getServerGuild() || (guildManager
+ && guildManager->havePower()))
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@guild|%s@@", _("Invite to guild")));
+ }
}
}
}
@@ -897,7 +928,12 @@ void PopupMenu::handleLink(const std::string &link,
{
const Guild *guild = player_node->getGuild();
if (guild)
- Net::getGuildHandler()->invite(guild->getId(), mNick);
+ {
+ if (guild->getServerGuild())
+ Net::getGuildHandler()->invite(guild->getId(), mNick);
+ else if (guildManager)
+ guildManager->invite(mNick);
+ }
}
}
else if (link == "nuke" && being)
@@ -1263,7 +1299,12 @@ void PopupMenu::handleLink(const std::string &link,
{
const Guild *guild = player_node->getGuild();
if (guild)
- Net::getGuildHandler()->kick(guild->getMember(mNick));
+ {
+ if (guild->getServerGuild())
+ Net::getGuildHandler()->kick(guild->getMember(mNick));
+ else if (guildManager)
+ guildManager->kick(mNick);
+ }
}
}
else if (link == "enable highlight" && mTab)