diff options
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 16 |
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 |