diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-28 18:13:57 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-03-28 18:13:57 -0600 |
commit | 088c0e4680d8013f01bdc70ac4f340f98afa2394 (patch) | |
tree | d3a103c962d8c8569bfab982882953e91326da65 /src/gui | |
parent | d7ffc90de680965edef7aa432d3bc3fd15986850 (diff) | |
download | mana-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.gz mana-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.bz2 mana-088c0e4680d8013f01bdc70ac4f340f98afa2394.tar.xz mana-088c0e4680d8013f01bdc70ac4f340f98afa2394.zip |
Clean up eAthena party handling a bit more
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/partywindow.cpp | 27 | ||||
-rw-r--r-- | src/gui/partywindow.h | 3 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 1f87b26f..f5cebdfd 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -24,9 +24,14 @@ #include "gui/widgets/avatar.h" #include "gui/widgets/chattab.h" +#ifdef TMWSERV_SUPPORT #include "net/tmwserv/chatserver/party.h" +#else +#include "net/ea/party.h" +#endif #include "utils/gettext.h" +#include "utils/strprintf.h" PartyWindow::PartyWindow() : Window(_("Party")) { @@ -107,7 +112,8 @@ void PartyWindow::removePartyMember(const std::string &memberName) } } -void PartyWindow::showPartyInvite(const std::string &inviter) +void PartyWindow::showPartyInvite(const std::string &inviter, + const std::string &partyName) { // check there isnt already an invite showing if (mPartyInviter != "") @@ -117,8 +123,15 @@ void PartyWindow::showPartyInvite(const std::string &inviter) return; } + std::string msg; // log invite - std::string msg = inviter + " has invited you to join their party"; + if (partyName.empty()) + msg = strprintf("%s has invited you to join their party", + inviter.c_str()); + else + msg = strprintf("%s has invited you to join the %s party", + inviter.c_str(), partyName.c_str()); + localChatTab->chatLog(msg, BY_SERVER); // show invite @@ -136,11 +149,21 @@ void PartyWindow::action(const gcn::ActionEvent &event) if (eventId == "yes") { localChatTab->chatLog("Accepted invite from " + mPartyInviter); +#ifdef TMWSERV_SUPPORT Net::ChatServer::Party::acceptInvite(mPartyInviter); +#else + eAthena::Party::respondToInvite(true); +#endif mPartyInviter = ""; } else if (eventId == "no") { + localChatTab->chatLog("Rejected invite from " + mPartyInviter); +#ifdef TMWSERV_SUPPORT + // TODO +#else + eAthena::Party::respondToInvite(false); +#endif mPartyInviter = ""; } } diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h index b587cc42..64cfb582 100644 --- a/src/gui/partywindow.h +++ b/src/gui/partywindow.h @@ -77,7 +77,8 @@ class PartyWindow : public Window, gcn::ActionListener /** * Show party invite */ - void showPartyInvite(const std::string &inviter); + void showPartyInvite(const std::string &inviter, + const std::string &partyName = ""); /** * Handle events |