From 5c53aa25e29e04f0f407cab0b6fa144b54577291 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 3 Apr 2015 16:01:52 +0300 Subject: Add mute/unmute gm context menu for 1,5,10,15,30 minutes. --- src/gui/popups/popupmenu.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index bc6c1fac8..5ef07eb69 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1519,6 +1519,22 @@ void PopupMenu::handleLink(const std::string &link, if (id >= 0) inputManager.executeAction(id); } + else if (!link.compare(0, 6, "mute_+")) + { + if (being) + { + const int time = atoi(link.substr(6).c_str()); + adminHandler->mute(being, 1, time); + } + } + else if (!link.compare(0, 6, "mute_-")) + { + if (being) + { + const int time = atoi(link.substr(6).c_str()); + adminHandler->mute(being, 0, time); + } + } else if (!link.empty() && link[0] == '/') { std::string cmd = link.substr(1); @@ -2601,6 +2617,51 @@ void PopupMenu::showGMPopup() // TRANSLATORS: kick player mBrowserBox->addRow("/kick :'BEINGID'", _("Kick")); } + if (serverFeatures->haveMute()) + { + mBrowserBox->addRow("##3---"); + mBrowserBox->addRow("mute_+1", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Mute %d"), 1).c_str()); + mBrowserBox->addRow("mute_+5", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Mute %d"), 5).c_str()); + mBrowserBox->addRow("mute_+10", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Mute %d"), 10).c_str()); + mBrowserBox->addRow("mute_+15", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Mute %d"), 15).c_str()); + mBrowserBox->addRow("mute_+30", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Mute %d"), 30).c_str()); + + mBrowserBox->addRow("mute_-1", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Unmute %d"), 1).c_str()); + mBrowserBox->addRow("mute_-5", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Unmute %d"), 5).c_str()); + mBrowserBox->addRow("mute_-10", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Unmute %d"), 10).c_str()); + mBrowserBox->addRow("mute_-15", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Unmute %d"), 15).c_str()); + mBrowserBox->addRow("mute_-30", + // TRANSLATORS: popup menu item + // TRANSLATORS: mute player + strprintf(_("Unmute %d"), 30).c_str()); + } } mBrowserBox->addRow("##3---"); -- cgit v1.2.3-70-g09d2