diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-29 01:55:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-29 01:55:41 +0300 |
commit | 9956ff63ccfaee02ed68d0125007b90849cc1ee5 (patch) | |
tree | 0cf8ee36f9cd39471590234de1adde3d0edeaf27 /src/gui | |
parent | 60100c4b30f779fe8f63758f9974891e98816340 (diff) | |
download | plus-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.gz plus-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.bz2 plus-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.xz plus-9956ff63ccfaee02ed68d0125007b90849cc1ee5.zip |
Add chat command /partyrecall. Also add it to npc context menu.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 49073811d..13e54ba3e 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1563,6 +1563,19 @@ void PopupMenu::handleLink(const std::string &link, } replaceAll(cmd, "'CARDS'", cards); replaceAll(cmd, "'ECARDS'", escapeString(cards)); + if (actorManager) + { + if (!being) + { + being = actorManager->findBeingByName(mName, + ActorType::Player); + } + } + if (being) + replaceAll(cmd, "'PARTY'", being->getPartyName()); + else + replaceAll(cmd, "'PARTY'", ""); + const size_t pos = cmd.find(' '); const std::string type(cmd, 0, pos); std::string args(cmd, pos == std::string::npos ? cmd.size() : pos + 1); @@ -2756,6 +2769,15 @@ void PopupMenu::showPlayerGMCommands(const std::string &name) mBrowserBox->addRow("/alive 'NAME'", _("Revive")); if (!legacy) { + Being *const being = actorManager->findBeingByName(name, + ActorType::Player); + if (being && !being->getPartyName().empty()) + { + mBrowserBox->addRow("/partyrecall 'PARTY'", + // TRANSLATORS: popup menu item + // TRANSLATORS: recall all party to player location + _("Recall party")); + } if (localPlayer && localPlayer->isInParty()) { const Party *const party = localPlayer->getParty(); |