summaryrefslogtreecommitdiff
path: root/src/net/tmwa/npchandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-17 14:42:42 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-17 14:42:42 +0300
commita714d83889a34d30b542c3c6ab7c49228fe71f53 (patch)
tree0e5f9887c73b5c0854b30370714c2cc3579acf61 /src/net/tmwa/npchandler.cpp
parent79114bbfe4bddf95345c33505a750f3aa80f1c56 (diff)
downloadplus-a714d83889a34d30b542c3c6ab7c49228fe71f53.tar.gz
plus-a714d83889a34d30b542c3c6ab7c49228fe71f53.tar.bz2
plus-a714d83889a34d30b542c3c6ab7c49228fe71f53.tar.xz
plus-a714d83889a34d30b542c3c6ab7c49228fe71f53.zip
Add support for set npc dialog title from server script.
Change client version netcode to 12.
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r--src/net/tmwa/npchandler.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 7dc926c73..18191769f 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -57,6 +57,7 @@ NpcHandler::NpcHandler() :
SMSG_NPC_INT_INPUT,
SMSG_NPC_STR_INPUT,
SMSG_NPC_COMMAND,
+ SMSG_NPC_CHANGETITLE,
0
};
handledMessages = _messages;
@@ -66,8 +67,10 @@ NpcHandler::NpcHandler() :
void NpcHandler::handleMessage(Net::MessageIn &msg)
{
BLOCK_START("NpcHandler::handleMessage")
+
const int npcId = getNpc(msg, msg.getId() == SMSG_NPC_CHOICE
- || msg.getId() == SMSG_NPC_MESSAGE);
+ || msg.getId() == SMSG_NPC_MESSAGE
+ || msg.getId() == SMSG_NPC_CHANGETITLE);
if (msg.getId() != SMSG_NPC_STR_INPUT)
mRequestLang = false;
@@ -105,6 +108,10 @@ void NpcHandler::handleMessage(Net::MessageIn &msg)
processNpcCommand(msg, npcId);
break;
+ case SMSG_NPC_CHANGETITLE:
+ processChangeTitle(msg, npcId);
+ break;
+
default:
break;
}
@@ -339,4 +346,11 @@ void NpcHandler::processLangReuqest(Net::MessageIn &msg A_UNUSED,
stringInput(npcId, getLangSimple());
}
+void NpcHandler::processChangeTitle(Net::MessageIn &msg, const int npcId) const
+{
+ const std::string str = msg.readString();
+ if (mDialog)
+ mDialog->setCaption(str);
+}
+
} // namespace TmwAthena