summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 16:27:39 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 16:27:39 +0300
commitf0906ab944c982da76a5c123100e567e1db680ac (patch)
treef75c07ed5e944aa1515ad165d7dfaa7c2d77ec03 /src
parent525ed1b797b1564575c8b7269276133b8b6e5f10 (diff)
downloadplus-f0906ab944c982da76a5c123100e567e1db680ac.tar.gz
plus-f0906ab944c982da76a5c123100e567e1db680ac.tar.bz2
plus-f0906ab944c982da76a5c123100e567e1db680ac.tar.xz
plus-f0906ab944c982da76a5c123100e567e1db680ac.zip
Add chat command /mobspawnsearch. Add it to monster gm context menu.
Diffstat (limited to 'src')
-rw-r--r--src/actions/commands.cpp9
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp5
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp5
-rw-r--r--src/net/eathena/adminhandler.h2
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h3
11 files changed, 38 insertions, 1 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 2adef54ca..f1ac3d962 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1254,4 +1254,13 @@ impHandler(mobSearch)
return true;
}
+impHandler(mobSpawnSearch)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->mobSpawnSearch(args);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 07b5dda2e..1df1effd2 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -101,6 +101,7 @@ namespace Actions
decHandler(itemInfo);
decHandler(whoDrops);
decHandler(mobSearch);
+ decHandler(mobSpawnSearch);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index 18278f6a1..2a7c81ec0 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -101,5 +101,6 @@ impHandlerVoid(monsterInfo)
impHandlerVoid(itemInfo)
impHandlerVoid(whoDrops)
impHandlerVoid(mobSearch)
+impHandlerVoid(mobSpawnSearch)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 019df826a..f74a7ddb3 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -630,6 +630,7 @@ enumStart(InputAction)
ITEM_INFO,
WHO_DROPS,
MOB_SEARCH,
+ MOB_SPAWN_SEARCH,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 3d527e405..69ecf11c8 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -2747,10 +2747,13 @@ void PopupMenu::showMonsterGMCommands()
// TRANSLATORS: popup menu item
// TRANSLATORS: show monster information
mBrowserBox->addRow("/monsterinfo 'BEINGSUBTYPEID'", _("Info"));
-
// TRANSLATORS: popup menu item
// TRANSLATORS: show selected monster in current map
mBrowserBox->addRow("/mobsearch 'BEINGSUBTYPEID'", _("Search"));
+ mBrowserBox->addRow("/mobspawnsearch 'BEINGSUBTYPEID'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: show selected monster spawns in all maps
+ _("Search spawns"));
}
}
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index e7322d456..26ed69906 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5269,6 +5269,12 @@ static const InputActionData inputActionData
"mobsearch|monstersearch",
UseArgs_true,
Protected_true},
+ {"keyMobSpawnSearch",
+ defaultAction(&Actions::mobSpawnSearch),
+ InputCondition::INGAME,
+ "mobspawnsearch|monsterspawnsearch|whereis",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index caa5098b9..38e909cdb 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -104,6 +104,8 @@ class AdminHandler notfinal
virtual void whoDrops(const std::string &name) const = 0;
virtual void mobSearch(const std::string &name) const = 0;
+
+ virtual void mobSpawnSearch(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index d13c29a31..630062167 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -182,4 +182,9 @@ void AdminHandler::mobSearch(const std::string &name) const
chatHandler->talk("@mobsearch " + name, GENERAL_CHANNEL);
}
+void AdminHandler::mobSpawnSearch(const std::string &name) const
+{
+ chatHandler->talk("@whereis " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 79ce6cf23..de65a3f48 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -79,6 +79,8 @@ class AdminHandler final : public Ea::AdminHandler
void mobSearch(const std::string &name) const override final;
+ void mobSpawnSearch(const std::string &name) const override final;
+
protected:
static std::string mStatsName;
};
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index e26806c8d..1c745c81f 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -142,4 +142,8 @@ void AdminHandler::mobSearch(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::mobSpawnSearch(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index 94ec3b7be..57b682703 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -80,6 +80,9 @@ class AdminHandler final : public Ea::AdminHandler
void whoDrops(const std::string &name) const override final A_CONST;
void mobSearch(const std::string &name) const override final A_CONST;
+
+ void mobSpawnSearch(const std::string &name) const override final
+ A_CONST;
};
} // namespace TmwAthena