summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-23 20:01:33 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-23 20:01:33 +0300
commit5bebc140ca792ce6438352629c4dead69711f813 (patch)
treeefd398835995898eb918c92df4ebe883583b717f
parente252f8d84e9b9c69bc02c128be5141407e928117 (diff)
downloadplus-5bebc140ca792ce6438352629c4dead69711f813.tar.gz
plus-5bebc140ca792ce6438352629c4dead69711f813.tar.bz2
plus-5bebc140ca792ce6438352629c4dead69711f813.tar.xz
plus-5bebc140ca792ce6438352629c4dead69711f813.zip
Add basic gm menu for different being types.
Add kick into monster and npc menu.
-rw-r--r--src/gui/popups/popupmenu.cpp178
-rw-r--r--src/gui/popups/popupmenu.h6
2 files changed, 123 insertions, 61 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 45add13e5..d2eaeab21 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -270,6 +270,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
mBrowserBox->addRow("/sell 'NAME'", _("Sell"));
}
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: move to npc location
@@ -288,6 +289,8 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: attack monster
mBrowserBox->addRow("/attack :'BEINGID'", _("Attack"));
+ addGmCommands();
+ mBrowserBox->addRow("##3---");
if (config.getBoolValue("enableAttackFilter"))
{
@@ -325,6 +328,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: Mercenary move to master
mBrowserBox->addRow("mercenary to master", _("Move to master"));
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: fire mercenary
@@ -339,6 +343,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: feed homunculus
mBrowserBox->addRow("homunculus feed", _("Feed"));
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: delete homunculus
@@ -358,6 +363,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: pet unequip item
mBrowserBox->addRow("pet unequip", _("Unequip"));
+ addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: pet rename item
@@ -2632,6 +2638,94 @@ void PopupMenu::addGmCommands()
}
}
+void PopupMenu::showPlayerGMCommands()
+{
+ // 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"));
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: recall player to current position
+ mBrowserBox->addRow("recall", _("Recall"));
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: revive player
+ mBrowserBox->addRow("revive", _("Revive"));
+ if (mBeingId != BeingId_zero)
+ {
+ // 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());
+
+ 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::showNpcGMCommands()
+{
+ if (mBeingId != BeingId_zero)
+ {
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: kick player
+ mBrowserBox->addRow("/kick :'BEINGID'", _("Kick"));
+ }
+}
+
+void PopupMenu::showMonsterGMCommands()
+{
+ if (mBeingId != BeingId_zero)
+ {
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: kick player
+ mBrowserBox->addRow("/kick :'BEINGID'", _("Kick"));
+ mBrowserBox->addRow("##3---");
+ }
+}
+
void PopupMenu::showGMPopup()
{
mBrowserBox->clearRows();
@@ -2639,68 +2733,30 @@ void PopupMenu::showGMPopup()
mBrowserBox->addRow(_("GM commands"));
if (localPlayer->isGM())
{
- // 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"));
- // TRANSLATORS: popup menu item
- // TRANSLATORS: recall player to current position
- mBrowserBox->addRow("recall", _("Recall"));
- // TRANSLATORS: popup menu item
- // TRANSLATORS: revive player
- mBrowserBox->addRow("revive", _("Revive"));
- if (mBeingId != BeingId_zero)
+ switch (mType)
{
- // 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());
-
- 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());
- }
+ case ActorType::Player:
+ showPlayerGMCommands();
+ break;
+ case ActorType::Npc:
+ showNpcGMCommands();
+ break;
+ case ActorType::Monster:
+ showMonsterGMCommands();
+ break;
+ default:
+ case ActorType::Unknown:
+ case ActorType::FloorItem:
+ case ActorType::Portal:
+ case ActorType::LocalPet:
+ case ActorType::Avatar:
+#ifdef EATHENA_SUPPORT
+ case ActorType::Pet:
+ case ActorType::Mercenary:
+ case ActorType::Homunculus:
+ case ActorType::SkillUnit:
+#endif
+ break;
}
}
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index dfcb64513..7041afb5b 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -216,6 +216,12 @@ class PopupMenu final : public Popup, public LinkHandler
void showGMPopup();
+ void showPlayerGMCommands();
+
+ void showNpcGMCommands();
+
+ void showMonsterGMCommands();
+
bool addBeingMenu();
BrowserBox *mBrowserBox A_NONNULLPOINTER;