summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-08 20:52:34 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-08 20:52:34 +0300
commitcb7e5cfdc0cf92d28661f37bbfa91b39ddb92028 (patch)
tree7965ebb2bcf9876b9884ab379eedf7596c33b85e /src/gui/popups/popupmenu.cpp
parentdd77c2e6a62ba20b0887f2b3ea39b8f748f44ec7 (diff)
downloadplus-cb7e5cfdc0cf92d28661f37bbfa91b39ddb92028.tar.gz
plus-cb7e5cfdc0cf92d28661f37bbfa91b39ddb92028.tar.bz2
plus-cb7e5cfdc0cf92d28661f37bbfa91b39ddb92028.tar.xz
plus-cb7e5cfdc0cf92d28661f37bbfa91b39ddb92028.zip
Allow send whisper to npc from context menu if server have this feature.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 2670b5384..f6a2959bd 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -245,11 +245,15 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
}
case ActorType::Npc:
- // NPCs can be talked to (single option, candidate for removal
- // unless more options would be added)
// TRANSLATORS: popup menu item
// TRANSLATORS: talk with npc
mBrowserBox->addRow("talk", _("Talk"));
+ if (serverFeatures->haveNpcWhispers())
+ {
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: whisper to npc
+ mBrowserBox->addRow("npc whisper", _("Whisper"));
+ }
// TRANSLATORS: popup menu item
// TRANSLATORS: buy from npc
mBrowserBox->addRow("buy", _("Buy"));
@@ -1183,6 +1187,21 @@ void PopupMenu::handleLink(const std::string &link,
}
}
}
+ else if (link == "npc whisper" && !mNick.empty())
+ {
+ if (chatWindow)
+ {
+ if (config.getBoolValue("whispertab"))
+ {
+ chatWindow->localChatInput("/q NPC:" + mNick);
+ }
+ else
+ {
+ chatWindow->addInputText(std::string("/w \"NPC:").append(
+ mNick).append("\" "));
+ }
+ }
+ }
else if (link == "move" && !mNick.empty())
{
if (localPlayer)