diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-24 18:41:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-24 18:41:46 +0300 |
commit | ed90e9aa17a5135988a1a85f159c1556f7d84bd1 (patch) | |
tree | 96d149f5c88eae4b0563f8bbc7aa60d51498ab8b /src | |
parent | bb604b783f5909d068ced29e17a698a37115ebb6 (diff) | |
download | manaplus-ed90e9aa17a5135988a1a85f159c1556f7d84bd1.tar.gz manaplus-ed90e9aa17a5135988a1a85f159c1556f7d84bd1.tar.bz2 manaplus-ed90e9aa17a5135988a1a85f159c1556f7d84bd1.tar.xz manaplus-ed90e9aa17a5135988a1a85f159c1556f7d84bd1.zip |
Add chat command /showinventory. Also add show inventory to player context menu.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/commands.cpp | 6 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/dyetool/actions/commands.cpp | 1 | ||||
-rw-r--r-- | src/enums/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 3 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 6 | ||||
-rw-r--r-- | src/net/adminhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/adminhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/adminhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.h | 3 |
11 files changed, 37 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 503cb95dc..07f633d4d 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1299,4 +1299,10 @@ impHandler(commandShowCart) return true; } +impHandler(commandShowInventory) +{ + adminHandler->showInventoryList(event.args); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index c425d7086..903bdc222 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -108,6 +108,7 @@ namespace Actions decHandler(commandShowStats); decHandler(commandShowStorage); decHandler(commandShowCart); + decHandler(commandShowInventory); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index f2a7f823b..d8a030a95 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -108,5 +108,6 @@ impHandlerVoid(commandShowLevel) impHandlerVoid(commandShowStats) impHandlerVoid(commandShowStorage) impHandlerVoid(commandShowCart) +impHandlerVoid(commandShowInventory) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index e4acdecdc..bf90ef531 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -637,6 +637,7 @@ enumStart(InputAction) COMMAND_SHOW_STATS, COMMAND_SHOW_STORAGE, COMMAND_SHOW_CART, + COMMAND_SHOW_INVENTORY, TOTAL } enumEnd(InputAction); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index da983f513..c5dacf2ba 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2670,6 +2670,9 @@ void PopupMenu::showPlayerGMCommands() // TRANSLATORS: show player stats mBrowserBox->addRow("/showstats 'NAME'", _("Show stats")); // TRANSLATORS: popup menu item + // TRANSLATORS: show player inventory list + mBrowserBox->addRow("/showinventory 'NAME'", _("Show inventory")); + // TRANSLATORS: popup menu item // TRANSLATORS: show player storage list mBrowserBox->addRow("/showstorage 'NAME'", _("Show storage")); // TRANSLATORS: popup menu item diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 698ce7765..c91321f3d 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5311,6 +5311,12 @@ static const InputActionData inputActionData "showcart|cartlist", UseArgs_true, Protected_true}, + {"keyCommandShowInventoryList", + defaultAction(&Actions::commandShowInventory), + InputCondition::INGAME, + "showinventory|inventorylist|itemlist", + UseArgs_true, + Protected_true}, }; #undef defaultAction diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index ffc180028..50f2f6500 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -118,6 +118,8 @@ class AdminHandler notfinal virtual void showStorageList(const std::string &name) const = 0; virtual void showCartList(const std::string &name) const = 0; + + virtual void showInventoryList(const std::string &name) const = 0; }; } // namespace Net diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 9530bd992..a877d3a63 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -235,4 +235,12 @@ void AdminHandler::showCartList(const std::string &name) const chatHandler->talk("#cartlist " + name, GENERAL_CHANNEL); } +void AdminHandler::showInventoryList(const std::string &name) const +{ + if (name.empty() || (localPlayer && name == localPlayer->getName())) + chatHandler->talk("@itemlist", GENERAL_CHANNEL); + else + chatHandler->talk("#itemlist " + name, GENERAL_CHANNEL); +} + } // namespace EAthena diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index 4d6c0f818..81c7ab2e9 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -94,6 +94,8 @@ class AdminHandler final : public Ea::AdminHandler void showCartList(const std::string &name) const override final; + void showInventoryList(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 55e2623e0..c5abc7535 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -170,4 +170,8 @@ void AdminHandler::showCartList(const std::string &name A_UNUSED) const { } +void AdminHandler::showInventoryList(const std::string &name A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 1211f5578..9b14e005d 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -99,6 +99,9 @@ class AdminHandler final : public Ea::AdminHandler void showCartList(const std::string &name) const override final A_CONST; + + void showInventoryList(const std::string &name) const override final + A_CONST; }; } // namespace TmwAthena |