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.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index c28f1403..b94e8aa4 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -29,10 +29,13 @@
#include "../npc.h"
+#include "../net/messageout.h"
+#include "../net/protocol.h"
+
#include "../utils/gettext.h"
-NpcTextDialog::NpcTextDialog():
- Window(_("NPC"))
+NpcTextDialog::NpcTextDialog(Network *network):
+ Window(_("NPC")), mNetwork(network)
{
setResizable(true);
@@ -87,12 +90,19 @@ void NpcTextDialog::action(const gcn::ActionEvent &event)
setVisible(false);
if (current_npc)
- current_npc->nextDialog();
+ nextDialog();
- current_npc = NULL;
+ current_npc = 0;
}
}
+void NpcTextDialog::nextDialog(int npcID)
+{
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_NPC_NEXT_REQUEST);
+ outMsg.writeInt32(npcID);
+}
+
void NpcTextDialog::widgetResized(const gcn::Event &event)
{
Window::widgetResized(event);