From 2b0176f628521b5eabb2e5874ff4c211ed18c2fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Sep 2014 18:25:22 +0300 Subject: Move processPartySettings from ea namespace into eathena and tmwa. --- src/net/tmwa/partyhandler.cpp | 23 +++++++++++++++++++++++ src/net/tmwa/partyhandler.h | 3 +++ 2 files changed, 26 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 12c011c89..c438b9302 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -22,11 +22,16 @@ #include "net/tmwa/partyhandler.h" #include "actormanager.h" +#include "configuration.h" #include "notifymanager.h" #include "party.h" #include "being/localplayer.h" +#include "gui/windows/chatwindow.h" + +#include "net/ea/gui/partytab.h" + #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" @@ -206,4 +211,22 @@ void PartyHandler::setShareItems(const Net::PartyShare::Type share) const outMsg.writeInt16(static_cast(share)); } +void PartyHandler::processPartySettings(Net::MessageIn &msg) +{ + if (!Ea::partyTab) + { + if (!chatWindow) + return; + + Ea::partyTab = new Ea::PartyTab(chatWindow); + if (config.getBoolValue("showChatHistory")) + Ea::partyTab->loadFromLogFile("#Party"); + } + + // These seem to indicate the sharing mode for exp and items + const int16_t exp = msg.readInt16(); + const int16_t item = msg.readInt16(); + processPartySettingsContinue(exp, item); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index ec8800316..1ffc8d1e0 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -62,6 +62,9 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void setShareItems(const Net::PartyShare::Type share) const override final; + + protected: + void processPartySettings(Net::MessageIn &msg); }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2