From 1f90dd8fea01c835816b3ed67f07561ae29b6ddc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Jan 2016 19:09:14 +0300 Subject: remove "remove from attack list" action from social window popup menu. --- src/actions/commands.cpp | 29 ++++++++++++++++++++--------- src/gui/popups/popupmenu.cpp | 27 +-------------------------- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 9f38844ee..1a1b07dd5 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -601,7 +601,7 @@ impHandler(addPriorityAttack) impHandler(addAttack) { - if (!actorManager || actorManager->isInAttackList(event.args)) + if (!actorManager) return false; actorManager->removeAttackMob(event.args); @@ -614,16 +614,27 @@ impHandler(addAttack) impHandler(removeAttack) { - if (!actorManager || - event.args.empty() || - (!actorManager->isInAttackList(event.args) && - !actorManager->isInPriorityAttackList(event.args) && - !actorManager->isInIgnoreAttackList(event.args))) - { + if (!actorManager) return false; + + if (event.args.empty()) + { + if (actorManager->isInAttackList(event.args)) + { + actorManager->removeAttackMob(event.args); + actorManager->addIgnoreAttackMob(event.args); + } + else + { + actorManager->removeAttackMob(event.args); + actorManager->addAttackMob(event.args); + } + } + else + { + actorManager->removeAttackMob(event.args); } - actorManager->removeAttackMob(event.args); if (socialWindow) socialWindow->updateAttackFilter(); @@ -632,7 +643,7 @@ impHandler(removeAttack) impHandler(addIgnoreAttack) { - if (!actorManager || actorManager->isInIgnoreAttackList(event.args)) + if (!actorManager) return false; actorManager->removeAttackMob(event.args); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index d2e4a100d..bc8a9fd2f 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1264,31 +1264,6 @@ void PopupMenu::handleLink(const std::string &link, } } } - else if (link == "attack remove") - { - if (actorManager) - { - if (mNick.empty()) - { - if (actorManager->isInAttackList(mNick)) - { - actorManager->removeAttackMob(mNick); - actorManager->addIgnoreAttackMob(mNick); - } - else - { - actorManager->removeAttackMob(mNick); - actorManager->addAttackMob(mNick); - } - } - else - { - actorManager->removeAttackMob(mNick); - } - if (socialWindow) - socialWindow->updateAttackFilter(); - } - } else if (link == "reset yellow") { GameModifiers::resetModifiers(); @@ -2070,7 +2045,7 @@ void PopupMenu::showAttackMonsterPopup(const int x, const int y, // TRANSLATORS: popup menu item // TRANSLATORS: remove attack target - mBrowserBox->addRow("attack remove", _("Remove")); + mBrowserBox->addRow("/removeattack 'NAME'", _("Remove")); mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: close menu -- cgit v1.2.3-70-g09d2