diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-13 16:22:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-13 16:22:46 +0300 |
commit | f40b3cd12dd2e2c65d02816c450e5645fba84109 (patch) | |
tree | 280e582f4a188cacc97973be3994a24b38218ed2 /src/gui/popups/popupmenu.cpp | |
parent | 767e9a19a27ecf4b7f5ea88e958c818fc56db9fd (diff) | |
download | manaplus-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.gz manaplus-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.bz2 manaplus-f40b3cd12dd2e2c65d02816c450e5645fba84109.tar.xz manaplus-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.cpp | 24 |
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: |