From 25da12e98285c44279d24ee77a08bd5f563d8ad0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Mar 2013 15:59:51 +0300 Subject: Add new notifications in some other classes. --- src/net/ea/chathandler.cpp | 24 +++++++++--------------- src/net/ea/tradehandler.cpp | 1 - src/net/eathena/adminhandler.cpp | 5 +++-- src/net/tmwa/adminhandler.cpp | 5 +++-- src/notifications.h | 14 ++++++++++++++ 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index b2c6154b3..9f67bfbcf 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -26,6 +26,7 @@ #include "configuration.h" #include "guildmanager.h" #include "localplayer.h" +#include "notifymanager.h" #include "playerrelations.h" #include "gui/chatwindow.h" @@ -353,14 +354,9 @@ void ChatHandler::processMVP(Net::MessageIn &msg) { const Being *const being = actorSpriteManager->findBeing(id); if (!being) - { - localChatTab->chatLog(_("MVP player."), BY_SERVER); - } + NotifyManager::notify(NotifyManager::MVP_PLAYER, ""); else - { - localChatTab->chatLog(_("MVP player: ") - + being->getName(), BY_SERVER); - } + NotifyManager::notify(NotifyManager::MVP_PLAYER, being->getName()); } } @@ -378,12 +374,11 @@ void ChatHandler::processIgnoreAllResponse(Net::MessageIn &msg) switch (fail) { case 0: - localChatTab->chatLog(_("All whispers ignored."), - BY_SERVER); + NotifyManager::notify(NotifyManager::WHISPERS_IGNORED); break; default: - localChatTab->chatLog(_("All whispers ignore failed."), - BY_SERVER); + NotifyManager::notify(NotifyManager:: + WHISPERS_IGNORE_FAILED); break; } break; @@ -393,12 +388,11 @@ void ChatHandler::processIgnoreAllResponse(Net::MessageIn &msg) switch (fail) { case 0: - localChatTab->chatLog(_("All whispers unignored."), - BY_SERVER); + NotifyManager::notify(NotifyManager::WHISPERS_UNIGNORED); break; default: - localChatTab->chatLog(_("All whispers unignore failed."), - BY_SERVER); + NotifyManager::notify(NotifyManager:: + WHISPERS_UNIGNORE_FAILED); break; } break; diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 12f29c4e7..3a401349a 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -22,7 +22,6 @@ #include "net/ea/tradehandler.h" -#include "depricatedevent.h" #include "inventory.h" #include "item.h" #include "logger.h" diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 0208b46d5..ba9551dc1 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -25,6 +25,7 @@ #include "actorspritemanager.h" #include "depricatedevent.h" #include "game.h" +#include "notifymanager.h" #include "playerrelations.h" #include "net/chathandler.h" @@ -63,9 +64,9 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) case SMSG_ADMIN_KICK_ACK: id = msg.readInt32(); if (id == 0) - SERVER_NOTICE(_("Kick failed!")) + NotifyManager::notify(NotifyManager::KICK_FAIL); else - SERVER_NOTICE(_("Kick succeeded!")) + NotifyManager::notify(NotifyManager::KICK_SUCCEED); default: break; } diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index dcb9d10a1..6f356c871 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -25,6 +25,7 @@ #include "actorspritemanager.h" #include "depricatedevent.h" #include "game.h" +#include "notifymanager.h" #include "playerrelations.h" #include "net/chathandler.h" @@ -63,9 +64,9 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) case SMSG_ADMIN_KICK_ACK: id = msg.readInt32(); if (id == 0) - SERVER_NOTICE(_("Kick failed!")) + NotifyManager::notify(NotifyManager::KICK_FAIL); else - SERVER_NOTICE(_("Kick succeeded!")) + NotifyManager::notify(NotifyManager::KICK_SUCCEED); default: break; } diff --git a/src/notifications.h b/src/notifications.h index 41c0734b4..6644d8ffe 100644 --- a/src/notifications.h +++ b/src/notifications.h @@ -100,6 +100,13 @@ namespace NotifyManager TRADE_ADD_ERROR, TRADE_CANCELLED, TRADE_COMPLETE, + KICK_FAIL, + KICK_SUCCEED, + MVP_PLAYER, + WHISPERS_IGNORED, + WHISPERS_IGNORE_FAILED, + WHISPERS_UNIGNORED, + WHISPERS_UNIGNORE_FAILED, TYPE_END }; @@ -163,6 +170,13 @@ namespace NotifyManager {N_("Failed adding item for unknown reason."), EMPTY}, {N_("Trade canceled."), EMPTY}, {N_("Trade completed."), EMPTY}, + {N_("Kick failed!"), EMPTY}, + {N_("Kick succeeded!"), EMPTY}, + {N_("MVP player: %s"), STRING}, + {N_("All whispers ignored."), EMPTY}, + {N_("All whispers ignore failed."), EMPTY}, + {N_("All whispers unignored."), EMPTY}, + {N_("All whispers unignore failed."), EMPTY}, }; } #endif -- cgit v1.2.3-60-g2f50