summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-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();