diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-27 16:23:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-27 16:23:45 +0300 |
commit | 23af9b972ec8d4a1094aadf0d0171f16d82a7fcb (patch) | |
tree | b4624e65abfb099a280183054fafe25f65299436 /src | |
parent | ab608a29a138cd5db47fad949f1f3993d21af153 (diff) | |
download | manaverse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.gz manaverse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.bz2 manaverse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.xz manaverse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.zip |
Improve undress popup menu item.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 19 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 6 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index eb6404d37..77da32cd4 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1155,9 +1155,24 @@ impHandler(undress) if (!actorManager || !localPlayer) return false; + const std::string args = event.args; + Being *target = nullptr; - if (!event.args.empty()) - target = actorManager->findNearestByName(event.args); + if (!args.empty()) + { + if (args[0] == ':') + { + target = actorManager->findBeing(fromInt(atoi( + args.substr(1).c_str()), BeingId)); + if (target && target->getType() == ActorType::Monster) + target = nullptr; + } + else + { + target = actorManager->findNearestByName(event.args); + } + } + if (!target) target = localPlayer->getTarget(); if (target && beingHandler) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index d1e23b558..74908fd98 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1078,10 +1078,6 @@ void PopupMenu::handleLink(const std::string &link, { CREATEWIDGET(TextCommandEditor, mSpell); } - else if (link == "undress" && being) - { - beingHandler->undress(being); - } else if (link == "addcomment" && !mNick.empty()) { TextDialog *const dialog = CREATEWIDGETR(TextDialog, @@ -2593,7 +2589,7 @@ void PopupMenu::addPlayerMisc() mBrowserBox->addRow("items", _("Show Items")); // TRANSLATORS: popup menu item // TRANSLATORS: undress player - mBrowserBox->addRow("undress", _("Undress")); + mBrowserBox->addRow("/undress :'BEINGID'", _("Undress")); // TRANSLATORS: popup menu item // TRANSLATORS: add comment to player mBrowserBox->addRow("addcomment", _("Add comment")); |