summaryrefslogtreecommitdiff
path: root/src/gui/popups
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
commit15b9391da7ba4c307311d7dae6abc81a4b2bf25c (patch)
tree22abbcd556824073008de3493a42839848cef969 /src/gui/popups
parentcd0883a1704c1b514b8b7317358949d43e230644 (diff)
downloadmanaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.gz
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.bz2
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.xz
manaplus-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.zip
Add chat command /npcmove. Also add it to npc context menu.
Diffstat (limited to 'src/gui/popups')
-rw-r--r--src/gui/popups/popupmenu.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 7ad1a63f3..5099cb5d7 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1514,6 +1514,7 @@ void PopupMenu::handleLink(const std::string &link,
{
std::string cmd = link.substr(1);
replaceAll(cmd, "'NAME'", mNick);
+ replaceAll(cmd, "'ENAME'", escapeString(mNick));
replaceAll(cmd, "'X'", toString(mX));
replaceAll(cmd, "'Y'", toString(mY));
replaceAll(cmd, "'BEINGID'", toString(toInt(mBeingId, int)));
@@ -1523,6 +1524,9 @@ void PopupMenu::handleLink(const std::string &link,
replaceAll(cmd, "'BEINGTYPEID'", toString(CAST_S32(mType)));
replaceAll(cmd, "'BEINGSUBTYPEID'", toString(CAST_S32(mSubType)));
replaceAll(cmd, "'PLAYER'", localPlayer->getName());
+ replaceAll(cmd, "'EPLAYER'", escapeString(localPlayer->getName()));
+ replaceAll(cmd, "'PLAYERX'", toString(localPlayer->getTileX()));
+ replaceAll(cmd, "'PLAYERY'", toString(localPlayer->getTileY()));
if (mItemIndex >= 0)
replaceAll(cmd, "'INVINDEX'", toString(mItemIndex));
else
@@ -1549,6 +1553,7 @@ void PopupMenu::handleLink(const std::string &link,
}
}
replaceAll(cmd, "'CARDS'", cards);
+ replaceAll(cmd, "'ECARDS'", escapeString(cards));
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);
@@ -2882,6 +2887,10 @@ void PopupMenu::showNpcGMCommands()
const bool legacy = Net::getNetworkType() == ServerType::TMWATHENA;
if (!legacy)
{
+ mBrowserBox->addRow("/npcmove 'NAME' 'PLAYERX' 'PLAYERY'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: warp npc to player location
+ _("Recall"));
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: warp to npc