summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-20 18:28:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-20 18:28:49 +0300
commit2f879820ee0e07b94a7c8189b8b7ab0720c3e208 (patch)
tree0d9c1a55cfb304c5e3fa5ea81b0202cb0e7f307d /src/net/ea
parentd4b88a7ebce6222c34928c49925f972515593e89 (diff)
downloadplus-2f879820ee0e07b94a7c8189b8b7ab0720c3e208.tar.gz
plus-2f879820ee0e07b94a7c8189b8b7ab0720c3e208.tar.bz2
plus-2f879820ee0e07b94a7c8189b8b7ab0720c3e208.tar.xz
plus-2f879820ee0e07b94a7c8189b8b7ab0720c3e208.zip
Move partyshare into separate file.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/gui/partytab.cpp28
-rw-r--r--src/net/ea/partyhandler.cpp40
-rw-r--r--src/net/ea/partyhandler.h8
3 files changed, 40 insertions, 36 deletions
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index 659ee9660..15ef5fc80 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -102,22 +102,22 @@ bool PartyTab::handleCommand(const std::string &restrict type,
{
switch (Net::getPartyHandler()->getShareItems())
{
- case PARTY_SHARE:
+ case Net::PartyShare::YES:
// TRANSLATORS: chat message
chatLog(_("Item sharing enabled."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_NO:
+ case Net::PartyShare::NO:
// TRANSLATORS: chat message
chatLog(_("Item sharing disabled."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_NOT_POSSIBLE:
+ case Net::PartyShare::NOT_POSSIBLE:
// TRANSLATORS: chat message
chatLog(_("Item sharing not possible."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_UNKNOWN:
+ case Net::PartyShare::UNKNOWN:
// TRANSLATORS: chat message
chatLog(_("Item sharing unknown."),
ChatMsgType::BY_SERVER);
@@ -132,10 +132,12 @@ bool PartyTab::handleCommand(const std::string &restrict type,
switch (opt)
{
case 1:
- Net::getPartyHandler()->setShareItems(PARTY_SHARE);
+ Net::getPartyHandler()->setShareItems(
+ Net::PartyShare::YES);
break;
case 0:
- Net::getPartyHandler()->setShareItems(PARTY_SHARE_NO);
+ Net::getPartyHandler()->setShareItems(
+ Net::PartyShare::NO);
break;
case -1:
chatLog(strprintf(BOOLEAN_OPTIONS, "item"));
@@ -150,22 +152,22 @@ bool PartyTab::handleCommand(const std::string &restrict type,
{
switch (Net::getPartyHandler()->getShareExperience())
{
- case PARTY_SHARE:
+ case Net::PartyShare::YES:
// TRANSLATORS: chat message
chatLog(_("Experience sharing enabled."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_NO:
+ case Net::PartyShare::NO:
// TRANSLATORS: chat message
chatLog(_("Experience sharing disabled."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_NOT_POSSIBLE:
+ case Net::PartyShare::NOT_POSSIBLE:
// TRANSLATORS: chat message
chatLog(_("Experience sharing not possible."),
ChatMsgType::BY_SERVER);
return true;
- case PARTY_SHARE_UNKNOWN:
+ case Net::PartyShare::UNKNOWN:
// TRANSLATORS: chat message
chatLog(_("Experience sharing unknown."),
ChatMsgType::BY_SERVER);
@@ -180,10 +182,12 @@ bool PartyTab::handleCommand(const std::string &restrict type,
switch (opt)
{
case 1:
- Net::getPartyHandler()->setShareExperience(PARTY_SHARE);
+ Net::getPartyHandler()->setShareExperience(
+ Net::PartyShare::YES);
break;
case 0:
- Net::getPartyHandler()->setShareExperience(PARTY_SHARE_NO);
+ Net::getPartyHandler()->setShareExperience(
+ Net::PartyShare::NO);
break;
case -1:
chatLog(strprintf(BOOLEAN_OPTIONS, "exp"));
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 51ef473f1..be672f760 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -47,8 +47,8 @@ PartyTab *partyTab = nullptr;
Party *taParty = nullptr;
PartyHandler::PartyHandler() :
- mShareExp(PARTY_SHARE_UNKNOWN),
- mShareItems(PARTY_SHARE_UNKNOWN)
+ mShareExp(Net::PartyShare::UNKNOWN),
+ mShareItems(Net::PartyShare::UNKNOWN)
{
taParty = Party::getParty(1);
}
@@ -253,22 +253,22 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg)
switch (exp)
{
- case PARTY_SHARE:
- if (mShareExp == PARTY_SHARE)
+ case Net::PartyShare::YES:
+ if (mShareExp == Net::PartyShare::YES)
break;
- mShareExp = PARTY_SHARE;
+ mShareExp = Net::PartyShare::YES;
NotifyManager::notify(NotifyManager::PARTY_EXP_SHARE_ON);
break;
- case PARTY_SHARE_NO:
- if (mShareExp == PARTY_SHARE_NO)
+ case Net::PartyShare::NO:
+ if (mShareExp == Net::PartyShare::NO)
break;
- mShareExp = PARTY_SHARE_NO;
+ mShareExp = Net::PartyShare::NO;
NotifyManager::notify(NotifyManager::PARTY_EXP_SHARE_OFF);
break;
- case PARTY_SHARE_NOT_POSSIBLE:
- if (mShareExp == PARTY_SHARE_NOT_POSSIBLE)
+ case Net::PartyShare::NOT_POSSIBLE:
+ if (mShareExp == Net::PartyShare::NOT_POSSIBLE)
break;
- mShareExp = PARTY_SHARE_NOT_POSSIBLE;
+ mShareExp = Net::PartyShare::NOT_POSSIBLE;
NotifyManager::notify(NotifyManager::PARTY_EXP_SHARE_ERROR);
break;
default:
@@ -278,22 +278,22 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg)
switch (item)
{
- case PARTY_SHARE:
- if (mShareItems == PARTY_SHARE)
+ case Net::PartyShare::YES:
+ if (mShareItems == Net::PartyShare::YES)
break;
- mShareItems = PARTY_SHARE;
+ mShareItems = Net::PartyShare::YES;
NotifyManager::notify(NotifyManager::PARTY_ITEM_SHARE_ON);
break;
- case PARTY_SHARE_NO:
- if (mShareItems == PARTY_SHARE_NO)
+ case Net::PartyShare::NO:
+ if (mShareItems == Net::PartyShare::NO)
break;
- mShareItems = PARTY_SHARE_NO;
+ mShareItems = Net::PartyShare::NO;
NotifyManager::notify(NotifyManager::PARTY_ITEM_SHARE_OFF);
break;
- case PARTY_SHARE_NOT_POSSIBLE:
- if (mShareItems == PARTY_SHARE_NOT_POSSIBLE)
+ case Net::PartyShare::NOT_POSSIBLE:
+ if (mShareItems == Net::PartyShare::NOT_POSSIBLE)
break;
- mShareItems = PARTY_SHARE_NOT_POSSIBLE;
+ mShareItems = Net::PartyShare::NOT_POSSIBLE;
NotifyManager::notify(NotifyManager::PARTY_ITEM_SHARE_ERROR);
break;
default:
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index 24923bd4a..19f66a238 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -46,10 +46,10 @@ class PartyHandler : public Net::PartyHandler
void join(const int partyId) const override final;
- PartyShare getShareExperience() const override final A_WARN_UNUSED
+ Net::PartyShare getShareExperience() const override final A_WARN_UNUSED
{ return mShareExp; }
- PartyShare getShareItems() const override final A_WARN_UNUSED
+ Net::PartyShare getShareItems() const override final A_WARN_UNUSED
{ return mShareItems; }
static void reload();
@@ -79,8 +79,8 @@ class PartyHandler : public Net::PartyHandler
virtual void processPartyMessage(Net::MessageIn &msg) const;
protected:
- PartyShare mShareExp;
- PartyShare mShareItems;
+ Net::PartyShare mShareExp;
+ Net::PartyShare mShareItems;
};
extern PartyTab *partyTab;