diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-10 04:32:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-10 04:32:18 +0300 |
commit | 1fa706c6669db9a2d060d100cf591fd505012a9d (patch) | |
tree | dee79462d680321e05c6a688146d2116f83bb3f6 /src/actions/windows.cpp | |
parent | 2291f18b6366312916903de6cfe973379ebd536d (diff) | |
download | mv-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.gz mv-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.bz2 mv-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.xz mv-1fa706c6669db9a2d060d100cf591fd505012a9d.zip |
Add chat command for show player items.s20170510
Diffstat (limited to 'src/actions/windows.cpp')
-rw-r--r-- | src/actions/windows.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp index 2e6c8d78c..bb7de28df 100644 --- a/src/actions/windows.cpp +++ b/src/actions/windows.cpp @@ -20,6 +20,8 @@ #include "actions/windows.h" +#include "actormanager.h" + #include "actions/actiondef.h" #include "being/localplayer.h" @@ -320,4 +322,40 @@ impHandler0(mailWindowShow) return true; } +impHandler(showItems) +{ + const std::string args = event.args; + if (args.empty()) + return false; + + Being *being = nullptr; + if (args[0] == ':') + { + being = actorManager->findBeing(fromInt(atoi( + args.substr(1).c_str()), BeingId)); + if (being && being->getType() == ActorType::Monster) + being = nullptr; + } + else + { + being = actorManager->findBeingByName(args, ActorType::Player); + } + if (!being) + return true; + if (being == localPlayer) + { + if (equipmentWindow && !equipmentWindow->isWindowVisible()) + equipmentWindow->setVisible(Visible_true); + } + else + { + if (beingEquipmentWindow) + { + beingEquipmentWindow->setBeing(being); + beingEquipmentWindow->setVisible(Visible_true); + } + } + return true; +} + } // namespace Actions |