From 252ab4b6bcc73c4a798ed4fce5768daf4eac779a Mon Sep 17 00:00:00 2001 From: ccc Date: Wed, 21 Dec 2022 11:17:02 +0100 Subject: Add mobinfo command to popup menu --- src/gui/popups/popupmenu.cpp | 7 +++++++ src/net/tmwa/adminhandler.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 0542fd72a..3ef275aae 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -414,6 +414,13 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) // TRANSLATORS: popup menu item // TRANSLATORS: add monster to ignore list _("Add to ignore list")); + if (isAllowCommand(ServerCommandType::mobinfo)) + { + mBrowserBox->addRow("/monsterinfo 'BEINGSUBTYPEID'", + // TRANSLATORS: popup menu item + // TRANSLATORS: show monster info + _("Monster info")); + } } } break; diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 3ec67f1e0..748e9c444 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -127,8 +127,9 @@ void AdminHandler::requestStats(const std::string &name A_UNUSED) const { } -void AdminHandler::monsterInfo(const std::string &name A_UNUSED) const +void AdminHandler::monsterInfo(const std::string &name) const { + Gm::runCommand("mobinfo", name); } void AdminHandler::itemInfo(const std::string &name A_UNUSED) const -- cgit v1.2.3-70-g09d2