summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
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)