summaryrefslogtreecommitdiff
path: root/src/gui/npc_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/npc_text.cpp')
-rw-r--r--src/gui/npc_text.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index 5bde7f36..5158e966 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -29,13 +29,24 @@
#include "../npc.h"
#include "../net/messageout.h"
-#include "../net/protocol.h"
+#ifdef TMWSERV_SUPPORT
+#include "../net/tmwserv/gameserver/player.h"
+#else
+#include "../net/ea/protocol.h"
+#endif
#include "../utils/gettext.h"
-NpcTextDialog::NpcTextDialog(Network *network):
- Window(_("NPC")), mNetwork(network),
- mState(NPC_TEXT_STATE_WAITING)
+#ifdef TMWSERV_SUPPORT
+NpcTextDialog::NpcTextDialog()
+#else
+NpcTextDialog::NpcTextDialog(Network *network)
+#endif
+ : Window(_("NPC"))
+#ifdef EATHENA_SUPPORT
+ , mNetwork(network)
+#endif
+ , mState(NPC_TEXT_STATE_WAITING)
{
setWindowName("NPCText");
setResizable(true);
@@ -122,16 +133,22 @@ void NpcTextDialog::action(const gcn::ActionEvent &event)
void NpcTextDialog::nextDialog(int npcID)
{
+#ifdef TMWSERV_SUPPORT
+ Net::GameServer::Player::talkToNPC(npcID, false);
+#else
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_NEXT_REQUEST);
outMsg.writeInt32(npcID);
+#endif
}
void NpcTextDialog::closeDialog(int npcID)
{
+#ifdef EATHENA_SUPPORT
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_CLOSE);
outMsg.writeInt32(npcID);
+#endif
}
void NpcTextDialog::widgetResized(const gcn::Event &event)