summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-03 16:01:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-03 16:01:52 +0300
commit5c53aa25e29e04f0f407cab0b6fa144b54577291 (patch)
tree923620bb930fc069606b00da4657924d6bb2c199
parente83cd5e5e4a5faae81f3731134a960820455af84 (diff)
downloadplus-5c53aa25e29e04f0f407cab0b6fa144b54577291.tar.gz
plus-5c53aa25e29e04f0f407cab0b6fa144b54577291.tar.bz2
plus-5c53aa25e29e04f0f407cab0b6fa144b54577291.tar.xz
plus-5c53aa25e29e04f0f407cab0b6fa144b54577291.zip
Add mute/unmute gm context menu for 1,5,10,15,30 minutes.
-rw-r--r--src/gui/popups/popupmenu.cpp61
1 files changed, 61 insertions, 0 deletions
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---");