summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 11:19:17 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 11:19:17 +0300
commit418d749f0d4889904d0b91e825a87e70a08d134c (patch)
tree5c244fcc48d343dd9ee8f6232b9f0fce92ca06c1 /src
parentdc5766216ee50103909d3b5dcdc5747c149855e0 (diff)
downloadmv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.gz
mv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.bz2
mv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.xz
mv-418d749f0d4889904d0b91e825a87e70a08d134c.zip
Remove getter for partyHandler.
Diffstat (limited to 'src')
-rw-r--r--src/actions/chat.cpp6
-rw-r--r--src/client.cpp2
-rw-r--r--src/gui/popups/popupmenu.cpp8
-rw-r--r--src/gui/widgets/tabs/socialpartytab.h4
-rw-r--r--src/gui/windows/socialwindow.cpp6
-rw-r--r--src/net/ea/gui/partytab.cpp24
-rw-r--r--src/net/net.cpp6
-rw-r--r--src/net/net.h2
-rw-r--r--src/net/partyhandler.h2
-rw-r--r--src/notifymanager.cpp4
-rw-r--r--src/utils/chatutils.cpp2
11 files changed, 31 insertions, 35 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index b5e507924..42b9fca24 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -61,7 +61,7 @@ static void outString(const ChatTab *const tab,
{
case ChatTabType::PARTY:
{
- Net::getPartyHandler()->chat(str);
+ partyHandler->chat(str);
break;
}
case ChatTabType::GUILD:
@@ -265,7 +265,7 @@ impHandler(createParty)
}
else
{
- Net::getPartyHandler()->create(event.args);
+ partyHandler->create(event.args);
}
return true;
}
@@ -294,7 +294,7 @@ impHandler(party)
if (!event.args.empty())
{
- Net::getPartyHandler()->invite(event.args);
+ partyHandler->invite(event.args);
}
else
{
diff --git a/src/client.cpp b/src/client.cpp
index d6dd49de8..0cde9295c 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -957,7 +957,7 @@ int Client::gameExec()
Guild::clearGuilds();
NpcDialog::clearDialogs();
guildHandler->clear();
- Net::getPartyHandler()->clear();
+ partyHandler->clear();
if (chatLogger)
chatLogger->clear();
if (!settings.options.dataPath.empty())
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index aa5a983fc..9aa99b229 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1292,12 +1292,12 @@ void PopupMenu::handleLink(const std::string &link,
else if (link == "party" && being &&
being->getType() == ActorType::Player)
{
- Net::getPartyHandler()->invite(being->getName());
+ partyHandler->invite(being->getName());
}
else if (link == "kick party" && being
&& being->getType() == ActorType::Player)
{
- Net::getPartyHandler()->kick(being);
+ partyHandler->kick(being);
}
else if (link == "kick party" && !mNick.empty())
{
@@ -1306,7 +1306,7 @@ void PopupMenu::handleLink(const std::string &link,
const PartyMember *const member = localPlayer->
getParty()->getMember(mNick);
if (member)
- Net::getPartyHandler()->kick(mNick);
+ partyHandler->kick(mNick);
}
}
else if (link == "name" && !mNick.empty())
@@ -1328,7 +1328,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "leave party" && mTab)
{
- Net::getPartyHandler()->leave();
+ partyHandler->leave();
}
else if (link == "chat clear" && mTab)
{
diff --git a/src/gui/widgets/tabs/socialpartytab.h b/src/gui/widgets/tabs/socialpartytab.h
index 9aea998d2..777a3ea6b 100644
--- a/src/gui/widgets/tabs/socialpartytab.h
+++ b/src/gui/widgets/tabs/socialpartytab.h
@@ -76,7 +76,7 @@ class SocialPartyTab final : public SocialTab,
if (eventId == "do invite")
{
const std::string name = mInviteDialog->getText();
- Net::getPartyHandler()->invite(name);
+ partyHandler->invite(name);
if (localChatTab)
{
@@ -94,7 +94,7 @@ class SocialPartyTab final : public SocialTab,
}
else if (eventId == "yes")
{
- Net::getPartyHandler()->leave();
+ partyHandler->leave();
if (localChatTab)
{
// TRANSLATORS: tab in social window
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 5b7868abb..e792d0a0a 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -277,7 +277,7 @@ void SocialWindow::action(const ActionEvent &event)
strprintf(_("Accepted party invite from %s."),
mPartyInviter.c_str()));
}
- Net::getPartyHandler()->inviteResponse(mPartyInviter, true);
+ partyHandler->inviteResponse(mPartyInviter, true);
}
else if (eventId == "no")
{
@@ -288,7 +288,7 @@ void SocialWindow::action(const ActionEvent &event)
strprintf(_("Rejected party invite from %s."),
mPartyInviter.c_str()));
}
- Net::getPartyHandler()->inviteResponse(mPartyInviter, false);
+ partyHandler->inviteResponse(mPartyInviter, false);
}
mPartyInviter.clear();
@@ -373,7 +373,7 @@ void SocialWindow::action(const ActionEvent &event)
if (name.size() > 16)
return;
- Net::getPartyHandler()->create(name);
+ partyHandler->create(name);
if (localChatTab)
{
// TRANSLATORS: chat message
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index 96b52b5e1..937245fc9 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -66,7 +66,7 @@ PartyTab::~PartyTab()
void PartyTab::handleInput(const std::string &msg)
{
- Net::getPartyHandler()->chat(ChatWindow::doReplace(msg));
+ partyHandler->chat(ChatWindow::doReplace(msg));
}
bool PartyTab::handleCommand(const std::string &restrict type,
@@ -81,26 +81,26 @@ bool PartyTab::handleCommand(const std::string &restrict type,
}
else
{
- Net::getPartyHandler()->create(args);
+ partyHandler->create(args);
}
}
else if (type == "invite")
{
- Net::getPartyHandler()->invite(args);
+ partyHandler->invite(args);
}
else if (type == "leave")
{
- Net::getPartyHandler()->leave();
+ partyHandler->leave();
}
else if (type == "kick")
{
- Net::getPartyHandler()->kick(args);
+ partyHandler->kick(args);
}
else if (type == "item")
{
if (args.empty())
{
- switch (Net::getPartyHandler()->getShareItems())
+ switch (partyHandler->getShareItems())
{
case Net::PartyShare::YES:
// TRANSLATORS: chat message
@@ -132,11 +132,11 @@ bool PartyTab::handleCommand(const std::string &restrict type,
switch (opt)
{
case 1:
- Net::getPartyHandler()->setShareItems(
+ partyHandler->setShareItems(
Net::PartyShare::YES);
break;
case 0:
- Net::getPartyHandler()->setShareItems(
+ partyHandler->setShareItems(
Net::PartyShare::NO);
break;
case -1:
@@ -150,7 +150,7 @@ bool PartyTab::handleCommand(const std::string &restrict type,
{
if (args.empty())
{
- switch (Net::getPartyHandler()->getShareExperience())
+ switch (partyHandler->getShareExperience())
{
case Net::PartyShare::YES:
// TRANSLATORS: chat message
@@ -182,11 +182,11 @@ bool PartyTab::handleCommand(const std::string &restrict type,
switch (opt)
{
case 1:
- Net::getPartyHandler()->setShareExperience(
+ partyHandler->setShareExperience(
Net::PartyShare::YES);
break;
case 0:
- Net::getPartyHandler()->setShareExperience(
+ partyHandler->setShareExperience(
Net::PartyShare::NO);
break;
case -1:
@@ -199,7 +199,7 @@ bool PartyTab::handleCommand(const std::string &restrict type,
else if (type == "setleader"
&& Net::getServerFeatures()->haveChangePartyLeader())
{
- Net::getPartyHandler()->changeLeader(args);
+ partyHandler->changeLeader(args);
}
else
{
diff --git a/src/net/net.cpp b/src/net/net.cpp
index ee375cfc3..34e4eb345 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -54,6 +54,7 @@ namespace Net
class LoginHandler;
class MailHandler;
class NpcHandler;
+ class PartyHandler;
}
Net::AdminHandler *adminHandler = nullptr;
@@ -79,11 +80,6 @@ Net::CashShopHandler *cashShopHandler = nullptr;
Net::FamilyHandler *familyHandler = nullptr;
Net::BankHandler *bankHandler = nullptr;
-Net::PartyHandler *Net::getPartyHandler()
-{
- return partyHandler;
-}
-
Net::PetHandler *Net::getPetHandler()
{
return petHandler;
diff --git a/src/net/net.h b/src/net/net.h
index e550cfc75..8dd94792b 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -36,14 +36,12 @@
namespace Net
{
-class PartyHandler;
class PetHandler;
class PlayerHandler;
class SkillHandler;
class TradeHandler;
class ServerFeatures;
-PartyHandler *getPartyHandler() A_WARN_UNUSED;
PetHandler *getPetHandler() A_WARN_UNUSED;
PlayerHandler *getPlayerHandler() A_WARN_UNUSED;
SkillHandler *getSkillHandler() A_WARN_UNUSED;
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index ac42fe2cd..f9905c837 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -81,4 +81,6 @@ class PartyHandler notfinal
} // namespace Net
+extern Net::PartyHandler *partyHandler;
+
#endif // NET_PARTYHANDLER_H
diff --git a/src/notifymanager.cpp b/src/notifymanager.cpp
index 4d885c86d..3ec039260 100644
--- a/src/notifymanager.cpp
+++ b/src/notifymanager.cpp
@@ -84,7 +84,7 @@ namespace NotifyManager
case NotifyFlags::PARTY:
{
- ChatTab *const tab = Net::getPartyHandler()->getTab();
+ ChatTab *const tab = partyHandler->getTab();
chatLog(tab, gettext(info.text));
break;
}
@@ -140,7 +140,7 @@ namespace NotifyManager
}
case NotifyFlags::PARTY_STRING:
{
- ChatTab *const tab = Net::getPartyHandler()->getTab();
+ ChatTab *const tab = partyHandler->getTab();
chatLog(tab, strprintf(gettext(info.text), str.c_str()));
break;
}
diff --git a/src/utils/chatutils.cpp b/src/utils/chatutils.cpp
index 926d696fb..3c6a4912e 100644
--- a/src/utils/chatutils.cpp
+++ b/src/utils/chatutils.cpp
@@ -56,7 +56,7 @@ void outStringNormal(ChatTab *const tab,
{
case ChatTabType::PARTY:
{
- Net::getPartyHandler()->chat(str);
+ partyHandler->chat(str);
break;
}
case ChatTabType::GUILD: