diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2010-08-24 17:24:14 +0200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-24 09:52:32 -0600 |
commit | 38474d0c3c14cf595aed61ee1e4a69d48abbcf92 (patch) | |
tree | 8664b7c0a8ca5ff7734e1cb31a7c7d4dfdd8b2bf /src/net/tmwa/partyhandler.cpp | |
parent | 000c3799eb85234b9baf5ede86dd966d929112d8 (diff) | |
download | mana-client-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.gz mana-client-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.bz2 mana-client-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.xz mana-client-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.zip |
Giving functionality to invite in socialwindow and allow enter key in textdialog
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/net/tmwa/partyhandler.cpp')
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index a92a27df..76108e9c 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -327,18 +327,24 @@ void PartyHandler::invite(Player *player) void PartyHandler::invite(const std::string &name) { - if (partyTab) + Being *invitee = beingManager->findBeingByName(name, Being::PLAYER); + + if (invitee) { - partyTab->chatLog(_("Inviting like this isn't supported at the moment."), - BY_SERVER); + invite((Player *)invitee); + partyTab->chatLog(strprintf(_("Invited user %s to party."), + name.c_str()), BY_SERVER); + } + else if (partyTab) + { + partyTab->chatLog(strprintf(_("Inviting failed, because you can't see " + "a player called %s."), name.c_str()), BY_SERVER); } else { localChatTab->chatLog(_("You can only inivte when you are in a party!"), BY_SERVER); } - - // TODO? } void PartyHandler::inviteResponse(const std::string &inviter, bool accept) |