summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-08-24 17:24:14 +0200
committerJared Adams <jaxad0127@gmail.com>2010-08-24 09:52:32 -0600
commit38474d0c3c14cf595aed61ee1e4a69d48abbcf92 (patch)
tree8664b7c0a8ca5ff7734e1cb31a7c7d4dfdd8b2bf /src
parent000c3799eb85234b9baf5ede86dd966d929112d8 (diff)
downloadmana-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.gz
mana-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.bz2
mana-38474d0c3c14cf595aed61ee1e4a69d48abbcf92.tar.xz
mana-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')
-rw-r--r--src/gui/socialwindow.cpp3
-rw-r--r--src/gui/textdialog.cpp2
-rw-r--r--src/net/tmwa/partyhandler.cpp16
3 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index f6e1d0aa..7a13f96b 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -203,9 +203,6 @@ public:
{
std::string name = mInviteDialog->getText();
Net::getPartyHandler()->invite(name);
-
- localChatTab->chatLog(strprintf(_("Invited user %s to party."),
- name.c_str()), BY_SERVER);
mInviteDialog = NULL;
}
else if (event.getId() == "~do invite")
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp
index 3e3aafe2..6faa1162 100644
--- a/src/gui/textdialog.cpp
+++ b/src/gui/textdialog.cpp
@@ -38,6 +38,8 @@ TextDialog::TextDialog(const std::string &title, const std::string &msg,
mOkButton = new Button(_("OK"), "OK", this);
gcn::Button *cancelButton = new Button(_("Cancel"), "CANCEL", this);
+ mTextField->addActionListener(this);
+
place(0, 0, textLabel, 4);
place(0, 1, mTextField, 4);
place(2, 2, mOkButton);
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)