diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-21 17:49:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-21 18:04:15 +0300 |
commit | f6e795cc95dce10e1df44a89bd03539e72888a32 (patch) | |
tree | c20a2eb1546f0c2ea17329b4c2c790c6ef1a23ad /src/commandhandler.cpp | |
parent | 005d429599088b523e4f62326824c7fb51ba9c63 (diff) | |
download | manaplus-f6e795cc95dce10e1df44a89bd03539e72888a32.tar.gz manaplus-f6e795cc95dce10e1df44a89bd03539e72888a32.tar.bz2 manaplus-f6e795cc95dce10e1df44a89bd03539e72888a32.tar.xz manaplus-f6e795cc95dce10e1df44a89bd03539e72888a32.zip |
Add attack filter char commands.
And place avatar list box separator without left padding.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 888451021..5211c64c3 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -35,6 +35,7 @@ #include "gui/gui.h" #include "gui/outfitwindow.h" #include "gui/shopwindow.h" +#include "gui/socialwindow.h" #include "gui/trade.h" #include "gui/sdlfont.h" @@ -259,6 +260,18 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) { handleUptime(args, tab); } + else if (type == "addattack") + { + handleAddAttack(args, tab); + } + else if (type == "removeattack" || type == "removeignoreattack") + { + handleRemoveAttack(args, tab); + } + else if (type == "addignoreattack") + { + handleAddIgnoreAttack(args, tab); + } else if (tab->handleCommand(type, args)) { // Nothing to do @@ -978,6 +991,44 @@ void CommandHandler::handleUptime(const std::string &args _UNUSED_, } } +void CommandHandler::handleAddAttack(const std::string &args, + ChatTab *tab _UNUSED_) +{ + if (!player_node || player_node->isInAttackList(args)) + return; + + player_node->removeAttackMob(args); + player_node->addAttackMob(args); + + if (socialWindow) + socialWindow->updateAttackFilter(); +} + +void CommandHandler::handleRemoveAttack(const std::string &args, + ChatTab *tab _UNUSED_) +{ + if (!player_node || args.empty() || !player_node->isInAttackList(args)) + return; + + player_node->removeAttackMob(args); + + if (socialWindow) + socialWindow->updateAttackFilter(); +} + +void CommandHandler::handleAddIgnoreAttack(const std::string &args, + ChatTab *tab _UNUSED_) +{ + if (!player_node || player_node->isInIgnoreAttackList(args)) + return; + + player_node->removeAttackMob(args); + player_node->addIgnoreAttackMob(args); + + if (socialWindow) + socialWindow->updateAttackFilter(); +} + void CommandHandler::handleCacheInfo(const std::string &args _UNUSED_, ChatTab *tab _UNUSED_) { |