summaryrefslogtreecommitdiff
path: root/src/gui/popups
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 22:51:57 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 22:51:57 +0300
commitc081738f258f5f312feb3acbcad892ba77d9810d (patch)
treed4202afdf66f69e8fcea107a09180b8883151603 /src/gui/popups
parent24dc1791c0b07e10334d61b95271cab7c2abcbf1 (diff)
downloadplus-c081738f258f5f312feb3acbcad892ba77d9810d.tar.gz
plus-c081738f258f5f312feb3acbcad892ba77d9810d.tar.bz2
plus-c081738f258f5f312feb3acbcad892ba77d9810d.tar.xz
plus-c081738f258f5f312feb3acbcad892ba77d9810d.zip
Move player mute/unmute commands into submenu.
Diffstat (limited to 'src/gui/popups')
-rw-r--r--src/gui/popups/popupmenu.cpp112
-rw-r--r--src/gui/popups/popupmenu.h2
2 files changed, 70 insertions, 44 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 530d78617..f1d769989 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1349,6 +1349,11 @@ void PopupMenu::handleLink(const std::string &link,
showGMPopup();
return;
}
+ else if (link == "mute" && !mNick.empty())
+ {
+ showMuteCommands();
+ return;
+ }
else if (link == "window close" && mWindow)
{
if (Widget::widgetExists(mWindow))
@@ -2715,52 +2720,71 @@ void PopupMenu::showPlayerGMCommands()
// TRANSLATORS: popup menu item
// 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());
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: mute menu
+ mBrowserBox->addRow("mute", _("Mute..."));
+ }
+}
- 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());
- }
+void PopupMenu::showMuteCommands()
+{
+ mBrowserBox->clearRows();
+ // TRANSLATORS: popup menu header
+ mBrowserBox->addRow(strprintf(_("Mute %s"),
+ mNick.c_str()));
+ if (mBeingId != BeingId_zero &&
+ serverFeatures->haveMute())
+ {
+ 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---");
}
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: back to gm menu
+ mBrowserBox->addRow("gm", _("Back"));
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: close menu
+ mBrowserBox->addRow("cancel", _("Cancel"));
+ showPopup(getX(), getY());
}
void PopupMenu::showNpcGMCommands()
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index b9e209977..e22c1331a 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -207,6 +207,8 @@ class PopupMenu final : public Popup, public LinkHandler
void addGmCommands();
+ void showMuteCommands();
+
void showFloorItemGMCommands();
void showItemGMCommands();