summaryrefslogtreecommitdiff
path: root/src/gui/npcpostdialog.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-12 20:58:30 -0500
committerChuck Miller <shadowmil@gmail.com>2010-11-12 21:16:08 -0500
commit009cfa4b2959bf89370e9d271f2244ef5446f3a0 (patch)
tree88f9185140a636b8c6fc3badfdec55cfee826290 /src/gui/npcpostdialog.cpp
parent9ac7645f10d1e419703bdd35b276ce6e4eaf8152 (diff)
downloadmana-009cfa4b2959bf89370e9d271f2244ef5446f3a0.tar.gz
mana-009cfa4b2959bf89370e9d271f2244ef5446f3a0.tar.bz2
mana-009cfa4b2959bf89370e9d271f2244ef5446f3a0.tar.xz
mana-009cfa4b2959bf89370e9d271f2244ef5446f3a0.zip
Change NPC handling in the net code
Instead of using events to invoke netcode, invoke netcode directly and have it send events Reviewed-by: Freeyorp
Diffstat (limited to 'src/gui/npcpostdialog.cpp')
-rw-r--r--src/gui/npcpostdialog.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp
index 7a85dda5..c53203be 100644
--- a/src/gui/npcpostdialog.cpp
+++ b/src/gui/npcpostdialog.cpp
@@ -30,6 +30,9 @@
#include "gui/widgets/textfield.h"
#include "gui/widgets/scrollarea.h"
+#include "net/net.h"
+#include "net/npchandler.h"
+
#include "utils/gettext.h"
NpcPostDialog::DialogList NpcPostDialog::instances;
@@ -97,11 +100,9 @@ void NpcPostDialog::action(const gcn::ActionEvent &event)
}
else
{
- Mana::Event event(EVENT_DOSENDLETTER);
- event.setInt("npcId", mNpcId);
- event.setString("recipient", mSender->getText());
- event.setString("text", mText->getText());
- event.trigger(CHANNEL_NPC);
+ Net::getNpcHandler()->sendLetter(mNpcId,
+ mSender->getText(),
+ mText->getText());
}
setVisible(false);
}