diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-16 16:15:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-16 16:15:34 +0300 |
commit | fe6a120ea38daaad39f6952a886c20269cfedca6 (patch) | |
tree | 4595d63a2ab9764873657182fbf2ab2b985474bf /src/net/ea | |
parent | 6279b10249efa59b3161b014899465fe4bb08da4 (diff) | |
download | manaverse-fe6a120ea38daaad39f6952a886c20269cfedca6.tar.gz manaverse-fe6a120ea38daaad39f6952a886c20269cfedca6.tar.bz2 manaverse-fe6a120ea38daaad39f6952a886c20269cfedca6.tar.xz manaverse-fe6a120ea38daaad39f6952a886c20269cfedca6.zip |
Move chatmsgtype into separate file.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/buysellhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 10 | ||||
-rw-r--r-- | src/net/ea/gui/guildtab.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/gui/partytab.cpp | 26 | ||||
-rw-r--r-- | src/net/ea/guildhandler.cpp | 24 |
5 files changed, 40 insertions, 30 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 28ec4497e..47074d99c 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -68,7 +68,7 @@ void BuySellHandler::requestSellList(const std::string &nick) const else { if (chatWindow) - chatWindow->addWhisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); } } @@ -87,7 +87,7 @@ void BuySellHandler::requestBuyList(const std::string &nick) const else { if (chatWindow) - chatWindow->addWhisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); } } @@ -106,7 +106,7 @@ void BuySellHandler::sendBuyRequest(const std::string &nick, if (config.getBoolValue("hideShopMessages")) Net::getChatHandler()->privateMessage(nick, data); else - chatWindow->addWhisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); } void BuySellHandler::sendSellRequest(const std::string &nick, @@ -125,7 +125,7 @@ void BuySellHandler::sendSellRequest(const std::string &nick, if (config.getBoolValue("hideShopMessages")) Net::getChatHandler()->privateMessage(nick, data); else - chatWindow->addWhisper(nick, data, BY_PLAYER); + chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); } void BuySellHandler::processNpcBuySellChoice(Net::MessageIn &msg) diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index cc43de8cd..c880de0f6 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -107,7 +107,7 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) chatWindow->addWhisper(nick, // TRANSLATORS: chat message strprintf(_("Whisper could not be " - "sent, %s is offline."), nick.c_str()), BY_SERVER); + "sent, %s is offline."), nick.c_str()), ChatMsgType::BY_SERVER); } break; case 0x02: @@ -117,7 +117,7 @@ void ChatHandler::processWhisperResponse(Net::MessageIn &msg) // TRANSLATORS: chat message strprintf(_("Whisper could not " "be sent, ignored by %s."), nick.c_str()), - BY_SERVER); + ChatMsgType::BY_SERVER); } break; default: @@ -256,7 +256,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg) const } else { - localChatTab->chatLog(chatMsg, BY_SERVER); + localChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER); } } BLOCK_END("ChatHandler::processWhisper") @@ -329,7 +329,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, PlayerRelation::SPEECH_LOG) && chatWindow) { allow = chatWindow->resortChatLog(removeColors(sender_name) - .append(" : ").append(chatMsg), BY_OTHER, channel, false, true); + .append(" : ").append(chatMsg), ChatMsgType::BY_OTHER, channel, false, true); } if (allow && player_relations.hasPermission(sender_name, @@ -367,7 +367,7 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, bool allow(true); if (chatWindow) { - allow = chatWindow->resortChatLog(chatMsg, BY_PLAYER, + allow = chatWindow->resortChatLog(chatMsg, ChatMsgType::BY_PLAYER, channel, false, true); } diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp index af8c3b8df..fbd3f0add 100644 --- a/src/net/ea/gui/guildtab.cpp +++ b/src/net/ea/gui/guildtab.cpp @@ -66,7 +66,7 @@ bool GuildTab::handleCommand(const std::string &restrict type, else if (type == "create" || type == "new") { if (args.empty()) - chatLog(_("Guild name is missing."), BY_SERVER); + chatLog(_("Guild name is missing."), ChatMsgType::BY_SERVER); else Net::getGuildHandler()->create(args); } diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index 79a9a8897..0395b3a94 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -75,7 +75,7 @@ bool PartyTab::handleCommand(const std::string &restrict type, if (args.empty()) { // TRANSLATORS: chat error message - chatLog(_("Party name is missing."), BY_SERVER); + chatLog(_("Party name is missing."), ChatMsgType::BY_SERVER); } else { @@ -102,19 +102,23 @@ bool PartyTab::handleCommand(const std::string &restrict type, { case PARTY_SHARE: // TRANSLATORS: chat message - chatLog(_("Item sharing enabled."), BY_SERVER); + chatLog(_("Item sharing enabled."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_NO: // TRANSLATORS: chat message - chatLog(_("Item sharing disabled."), BY_SERVER); + chatLog(_("Item sharing disabled."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_NOT_POSSIBLE: // TRANSLATORS: chat message - chatLog(_("Item sharing not possible."), BY_SERVER); + chatLog(_("Item sharing not possible."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_UNKNOWN: // TRANSLATORS: chat message - chatLog(_("Item sharing unknown."), BY_SERVER); + chatLog(_("Item sharing unknown."), + ChatMsgType::BY_SERVER); return true; default: break; @@ -146,19 +150,23 @@ bool PartyTab::handleCommand(const std::string &restrict type, { case PARTY_SHARE: // TRANSLATORS: chat message - chatLog(_("Experience sharing enabled."), BY_SERVER); + chatLog(_("Experience sharing enabled."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_NO: // TRANSLATORS: chat message - chatLog(_("Experience sharing disabled."), BY_SERVER); + chatLog(_("Experience sharing disabled."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_NOT_POSSIBLE: // TRANSLATORS: chat message - chatLog(_("Experience sharing not possible."), BY_SERVER); + chatLog(_("Experience sharing not possible."), + ChatMsgType::BY_SERVER); return true; case PARTY_SHARE_UNKNOWN: // TRANSLATORS: chat message - chatLog(_("Experience sharing unknown."), BY_SERVER); + chatLog(_("Experience sharing unknown."), + ChatMsgType::BY_SERVER); return true; default: break; diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 18877c686..efa94dce1 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -183,29 +183,31 @@ void GuildHandler::processGuildBasicInfo(Net::MessageIn &msg) showBasicInfo = false; // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Guild name: %s"), - name.c_str()), BY_SERVER); + name.c_str()), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Guild master: %s"), - master.c_str()), BY_SERVER); + master.c_str()), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild level: %d"), level), BY_SERVER); + guildTab->chatLog(strprintf(_("Guild level: %d"), level), + ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Online members: %d"), - members), BY_SERVER); + members), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Max members: %d"), - maxMembers), BY_SERVER); + maxMembers), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Average level: %d"), - avgLevel), BY_SERVER); + avgLevel), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message - guildTab->chatLog(strprintf(_("Guild exp: %d"), exp), BY_SERVER); + guildTab->chatLog(strprintf(_("Guild exp: %d"), exp), + ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Guild next exp: %d"), - nextExp), BY_SERVER); + nextExp), ChatMsgType::BY_SERVER); // TRANSLATORS: guild info message guildTab->chatLog(strprintf(_("Guild castle: %s"), - castle.c_str()), BY_SERVER); + castle.c_str()), ChatMsgType::BY_SERVER); } Guild *const g = Guild::getGuild(static_cast<int16_t>(guildId)); @@ -400,8 +402,8 @@ void GuildHandler::processGuildNotice(Net::MessageIn &msg) const const std::string msg2 = msg.readString(120); // Mes2 if (guildTab) { - guildTab->chatLog(msg1, BY_SERVER); - guildTab->chatLog(msg2, BY_SERVER); + guildTab->chatLog(msg1, ChatMsgType::BY_SERVER); + guildTab->chatLog(msg2, ChatMsgType::BY_SERVER); } } |