diff options
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 |