summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-10 04:32:18 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-10 04:32:18 +0300
commit1fa706c6669db9a2d060d100cf591fd505012a9d (patch)
treedee79462d680321e05c6a688146d2116f83bb3f6 /src/actions
parent2291f18b6366312916903de6cfe973379ebd536d (diff)
downloadmanaverse-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.gz
manaverse-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.bz2
manaverse-1fa706c6669db9a2d060d100cf591fd505012a9d.tar.xz
manaverse-1fa706c6669db9a2d060d100cf591fd505012a9d.zip
Add chat command for show player items.s20170510
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/windows.cpp38
-rw-r--r--src/actions/windows.h1
2 files changed, 39 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
diff --git a/src/actions/windows.h b/src/actions/windows.h
index 8026b9a6f..3820ee9fe 100644
--- a/src/actions/windows.h
+++ b/src/actions/windows.h
@@ -54,6 +54,7 @@ namespace Actions
decHandler(cartWindowShow);
decHandler(quickWindowShow);
decHandler(mailWindowShow);
+ decHandler(showItems);
} // namespace Actions
#undef decHandler