diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:59:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:59:31 +0300 |
commit | 00083cc82fdd40870f517d6954fe3b28cea72f65 (patch) | |
tree | d7abdbe970d784498a9ce87416d145074ab34332 | |
parent | 437586e9dad478fd63a96d442ab77b744ce6fec3 (diff) | |
download | manaverse-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.gz manaverse-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.bz2 manaverse-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.xz manaverse-00083cc82fdd40870f517d6954fe3b28cea72f65.zip |
Send talk request from context menu by being id.
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 2 | ||||
-rw-r--r-- | src/progs/manaplus/actions/actions.cpp | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 9e9e9d5d8..03398c6b5 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -329,7 +329,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) { // TRANSLATORS: popup menu item // TRANSLATORS: talk with npc - mBrowserBox->addRow("/talk 'NAME'", _("Talk")); + mBrowserBox->addRow("/talk :'BEINGID'", _("Talk")); #ifdef TMWA_SUPPORT if (Net::getNetworkType() != ServerType::TMWATHENA) #endif diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 5b5a00a05..9c0188d20 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -825,7 +825,19 @@ impHandler(sell) impHandler(talk) { - Being *being = findBeing(event.args, true); + const std::string args = event.args; + Being *being = nullptr; + + if (!args.empty() && args[0] == ':') + { + being = actorManager->findBeing(fromInt(atoi( + args.substr(1).c_str()), BeingId)); + } + else + { + being = findBeing(args, true); + } + if (being == nullptr) return false; |