diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-24 23:17:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-24 23:17:34 +0300 |
commit | d0967473d6f1e356592e8adbe46fcbbe04c60393 (patch) | |
tree | 10c929a51a165cf2de4f77e89c85612bdd1193ef /src/gui/popups/popupmenu.cpp | |
parent | c081738f258f5f312feb3acbcad892ba77d9810d (diff) | |
download | manaverse-d0967473d6f1e356592e8adbe46fcbbe04c60393.tar.gz manaverse-d0967473d6f1e356592e8adbe46fcbbe04c60393.tar.bz2 manaverse-d0967473d6f1e356592e8adbe46fcbbe04c60393.tar.xz manaverse-d0967473d6f1e356592e8adbe46fcbbe04c60393.zip |
Move "show ..." gm commands into submenu.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index f1d769989..6e063b98c 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1354,6 +1354,11 @@ void PopupMenu::handleLink(const std::string &link, showMuteCommands(); return; } + else if (link == "show" && !mNick.empty()) + { + showPlayerMenu(); + return; + } else if (link == "window close" && mWindow) { if (Widget::widgetExists(mWindow)) @@ -2663,38 +2668,53 @@ void PopupMenu::addGmCommands() } } -void PopupMenu::showPlayerGMCommands() +void PopupMenu::showPlayerMenu() { - // TRANSLATORS: popup menu item - // TRANSLATORS: find player position - mBrowserBox->addRow("/locateplayer 'NAME'", _("Locate")); - // TRANSLATORS: popup menu item - // TRANSLATORS: check player ip - mBrowserBox->addRow("ipcheck", _("Check ip")); + mBrowserBox->clearRows(); + // TRANSLATORS: popup menu header + mBrowserBox->addRow(strprintf(_("Show %s"), + mNick.c_str())); // TRANSLATORS: popup menu item // TRANSLATORS: show player account info - mBrowserBox->addRow("/showaccountinfo 'NAME'", _("Show account info")); + mBrowserBox->addRow("/showaccountinfo 'NAME'", _("Account info")); // TRANSLATORS: popup menu item // TRANSLATORS: show player level - mBrowserBox->addRow("/showlevel 'NAME'", _("Show level")); + mBrowserBox->addRow("/showlevel 'NAME'", _("Level")); // TRANSLATORS: popup menu item // TRANSLATORS: show player stats - mBrowserBox->addRow("/showstats 'NAME'", _("Show stats")); + mBrowserBox->addRow("/showstats 'NAME'", _("Stats")); // TRANSLATORS: popup menu item // TRANSLATORS: show player inventory list - mBrowserBox->addRow("/showinventory 'NAME'", _("Show inventory")); + mBrowserBox->addRow("/showinventory 'NAME'", _("Inventory")); // TRANSLATORS: popup menu item // TRANSLATORS: show player storage list - mBrowserBox->addRow("/showstorage 'NAME'", _("Show storage")); + mBrowserBox->addRow("/showstorage 'NAME'", _("Storage")); // TRANSLATORS: popup menu item // TRANSLATORS: show player cart list - mBrowserBox->addRow("/showcart 'NAME'", _("Show cart")); + mBrowserBox->addRow("/showcart 'NAME'", _("Cart")); // TRANSLATORS: popup menu item // TRANSLATORS: gm commands - mBrowserBox->addRow("/gmcommands 'NAME'", _("Show commands")); + mBrowserBox->addRow("/gmcommands 'NAME'", _("Commands")); // TRANSLATORS: popup menu item // TRANSLATORS: gm char commands - mBrowserBox->addRow("/gmcharcommands 'NAME'", _("Show char commands")); + mBrowserBox->addRow("/gmcharcommands 'NAME'", _("Char commands")); + // 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::showPlayerGMCommands() +{ + // TRANSLATORS: popup menu item + // TRANSLATORS: find player position + mBrowserBox->addRow("/locateplayer 'NAME'", _("Locate")); + // TRANSLATORS: popup menu item + // TRANSLATORS: check player ip + mBrowserBox->addRow("ipcheck", _("Check ip")); // TRANSLATORS: popup menu item // TRANSLATORS: go to player position mBrowserBox->addRow("goto", _("Goto")); @@ -2704,6 +2724,16 @@ void PopupMenu::showPlayerGMCommands() // TRANSLATORS: popup menu item // TRANSLATORS: revive player mBrowserBox->addRow("revive", _("Revive")); + if (mBeingId != BeingId_zero) + { + mBrowserBox->addRow("##3---"); + // TRANSLATORS: popup menu item + // TRANSLATORS: show menu + mBrowserBox->addRow("show", _("Show...")); + // TRANSLATORS: popup menu item + // TRANSLATORS: mute menu + mBrowserBox->addRow("mute", _("Mute...")); + } mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: spawn player clone @@ -2720,9 +2750,6 @@ void PopupMenu::showPlayerGMCommands() // TRANSLATORS: popup menu item // TRANSLATORS: kick player mBrowserBox->addRow("/kick :'BEINGID'", _("Kick")); - // TRANSLATORS: popup menu item - // TRANSLATORS: mute menu - mBrowserBox->addRow("mute", _("Mute...")); } } |