summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-07 01:30:24 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-07 01:30:24 +0300
commita66df732580a488c92dd680e8b9e7fc965ea1318 (patch)
tree6a64ddd676c8c847fdece66ecbb1333a0f281040 /src
parent086356622db7b0734be68c58e064544fa243be1b (diff)
downloadmv-a66df732580a488c92dd680e8b9e7fc965ea1318.tar.gz
mv-a66df732580a488c92dd680e8b9e7fc965ea1318.tar.bz2
mv-a66df732580a488c92dd680e8b9e7fc965ea1318.tar.xz
mv-a66df732580a488c92dd680e8b9e7fc965ea1318.zip
Add "Mail to..." command in player context menu.
Diffstat (limited to 'src')
-rw-r--r--src/gui/popups/popupmenu.cpp16
-rw-r--r--src/gui/popups/popupmenu.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 264b2a6cb..e87407260 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -178,6 +178,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: send whisper to player
mBrowserBox->addRow("/whispertext 'NAME'", _("Whisper"));
+ addMailCommands();
addGmCommands();
mBrowserBox->addRow("##3---");
@@ -505,6 +506,7 @@ void PopupMenu::showPlayerPopup(const std::string &nick)
// TRANSLATORS: popup menu item
// TRANSLATORS: send whisper to player
mBrowserBox->addRow("/whispertext 'NAME'", _("Whisper"));
+ addMailCommands();
addGmCommands();
mBrowserBox->addRow("##3---");
@@ -866,6 +868,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
// TRANSLATORS: popup menu item
// TRANSLATORS: attack player
mBrowserBox->addRow("/attack 'NAME'", _("Attack"));
+ addMailCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: heal player
@@ -932,6 +935,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
mSubType = BeingTypeId_zero;
addPlayerRelation(name);
mBrowserBox->addRow("##3---");
+ addMailCommands();
addFollow();
if (localPlayer->isInParty())
@@ -3138,6 +3142,18 @@ void PopupMenu::showCraftPopup()
}
#endif
+void PopupMenu::addMailCommands()
+{
+#ifdef EATHENA_SUPPORT
+ if (!serverFeatures->haveMail())
+ return;
+
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: open mail dialog
+ mBrowserBox->addRow("/mailto 'NAME'", _("Mail to..."));
+#endif
+}
+
void PopupMenu::moveUp()
{
mBrowserBox->moveSelectionUp();
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index ad4c943b8..2bf253a29 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -229,6 +229,8 @@ class PopupMenu final : public Popup, public LinkHandler
void addChat(const Being *const being);
#endif
+ void addMailCommands();
+
void showGMPopup(const std::string &name);
void showPlayerGMCommands(const std::string &name);