From a66df732580a488c92dd680e8b9e7fc965ea1318 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 7 Mar 2016 01:30:24 +0300 Subject: Add "Mail to..." command in player context menu. --- src/gui/popups/popupmenu.cpp | 16 ++++++++++++++++ src/gui/popups/popupmenu.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'src/gui') 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); -- cgit v1.2.3-60-g2f50