diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-11 21:25:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-11 21:25:00 +0300 |
commit | 2216a1e5cda198bbd6d97104136054a82ff9f739 (patch) | |
tree | c804057fcbf0863dad3656f95b2aeaa412e7b00a /src | |
parent | c5eb5667a14c59eba9590e8f0eff0f58da421046 (diff) | |
download | manaplus-2216a1e5cda198bbd6d97104136054a82ff9f739.tar.gz manaplus-2216a1e5cda198bbd6d97104136054a82ff9f739.tar.bz2 manaplus-2216a1e5cda198bbd6d97104136054a82ff9f739.tar.xz manaplus-2216a1e5cda198bbd6d97104136054a82ff9f739.zip |
Remove "heal" popup menu handler.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 17 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 13 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 03944500d..86191d51c 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -361,10 +361,21 @@ impHandler(heal) { if (actorManager && localPlayer) { - if (!event.args.empty()) + std::string args = event.args; + + if (!args.empty()) { - const Being *const being = actorManager->findBeingByName( - event.args, ActorType::Player); + const Being *being = nullptr; + if (args[0] == ':') + { + being = actorManager->findBeing(atoi(args.substr(1).c_str())); + if (being && being->getType() == ActorType::Monster) + being = nullptr; + } + else + { + being = actorManager->findBeingByName(args, ActorType::Player); + } if (being) actorManager->heal(being); } diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 1ebe7b2af..e6b5aad57 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -176,7 +176,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) // TRANSLATORS: popup menu item // TRANSLATORS: heal player - mBrowserBox->addRow("heal", _("Heal")); + mBrowserBox->addRow("/heal :'BEINGID'", _("Heal")); mBrowserBox->addRow("##3---"); addPlayerRelation(name); @@ -799,7 +799,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab) mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: heal player - mBrowserBox->addRow("heal", _("Heal")); + mBrowserBox->addRow("/heal :'BEINGID'", _("Heal")); mBrowserBox->addRow("##3---"); addPlayerRelation(name); mBrowserBox->addRow("##3---"); @@ -979,13 +979,8 @@ void PopupMenu::handleLink(const std::string &link, if (actorManager) being = actorManager->findBeing(mBeingId); - if (link == "heal" && being && being->getType() != ActorType::Monster) - { - if (actorManager) - actorManager->heal(being); - } - else if (link == "unignore" && being && - being->getType() == ActorType::Player) + if (link == "unignore" && being && + being->getType() == ActorType::Player) { player_relations.setRelation(being->getName(), PlayerRelation::NEUTRAL); |