summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-13 16:22:46 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-13 16:22:46 +0300
commitf40b3cd12dd2e2c65d02816c450e5645fba84109 (patch)
tree280e582f4a188cacc97973be3994a24b38218ed2 /src/gui/popups/popupmenu.cpp
parent767e9a19a27ecf4b7f5ea88e958c818fc56db9fd (diff)
downloadmanaverse-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.gz
manaverse-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.bz2
manaverse-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.xz
manaverse-f40b3cd12dd2e2c65d02816c450e5645fba84109.zip
For skill units in context menu show creator name or id.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 2405743c5..811efc881 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -160,7 +160,12 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
mY = y;
const std::string &name = mName;
- mBrowserBox->addRow(name + being->getGenderSignWithSpace());
+#ifdef EATHENA_SUPPORT
+ if (being->getType() != ActorType::SkillUnit)
+#endif
+ {
+ mBrowserBox->addRow(name + being->getGenderSignWithSpace());
+ }
switch (being->getType())
{
@@ -409,8 +414,23 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
}
break;
case ActorType::SkillUnit:
- // +++ need impliment menu
+ {
+ const BeingId id = being->getCreatorId();
+ std::string creatorName;
+ Being *const creator = actorManager->findBeing(id);
+ if (creator)
+ creatorName = creator->getName();
+ else
+ creatorName = actorManager->getSeenPlayerById(id);
+
+ if (creatorName.empty())
+ creatorName = strprintf("?%d", CAST_S32(id));
+
+ mBrowserBox->addRow(strprintf("%s (%s)",
+ name.c_str(),
+ creatorName.c_str()));
break;
+ }
#endif
case ActorType::Avatar:
case ActorType::Unknown: