From f40b3cd12dd2e2c65d02816c450e5645fba84109 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Mar 2016 16:22:46 +0300 Subject: For skill units in context menu show creator name or id. --- src/gui/popups/popupmenu.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/gui/popups') 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: -- cgit v1.2.3-70-g09d2