summaryrefslogtreecommitdiff
path: root/src/net/npchandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/npchandler.cpp')
-rw-r--r--src/net/npchandler.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp
index 4f3c4354..c597e31c 100644
--- a/src/net/npchandler.cpp
+++ b/src/net/npchandler.cpp
@@ -28,10 +28,14 @@
#include "../npc.h"
#include "../gui/npc_text.h"
+#include "../gui/npcintegerdialog.h"
#include "../gui/npclistdialog.h"
+#include "../gui/npcstringdialog.h"
+extern NpcIntegerDialog *npcIntegerDialog;
extern NpcListDialog *npcListDialog;
extern NpcTextDialog *npcTextDialog;
+extern NpcStringDialog *npcStringDialog;
NPCHandler::NPCHandler()
{
@@ -40,6 +44,8 @@ NPCHandler::NPCHandler()
SMSG_NPC_MESSAGE,
SMSG_NPC_NEXT,
SMSG_NPC_CLOSE,
+ SMSG_NPC_INT_INPUT,
+ SMSG_NPC_STR_INPUT,
0
};
handledMessages = _messages;
@@ -79,5 +85,21 @@ void NPCHandler::handleMessage(MessageIn *msg)
case SMSG_NPC_NEXT:
// Next button in NPC dialog, currently unused
break;
+
+ case SMSG_NPC_INT_INPUT:
+ // Request for an integer
+ id = msg->readInt32();
+ current_npc = dynamic_cast<NPC*>(beingManager->findBeing(id));
+ npcIntegerDialog->prepDialog(0, 0, 2147483647);
+ npcIntegerDialog->setVisible(true);
+ break;
+
+ case SMSG_NPC_STR_INPUT:
+ // Request for a string
+ id = msg->readInt32();
+ current_npc = dynamic_cast<NPC*>(beingManager->findBeing(id));
+ npcStringDialog->setValue("");
+ npcStringDialog->setVisible(true);
+ break;
}
}