diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-10 13:38:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-10 13:38:15 +0300 |
commit | 3d2779c31490e4ac32bf72380703b9785b4e00be (patch) | |
tree | 5e031ea09c985af905973899fab78049d08475e3 /src/gui/popups | |
parent | 44f9d02a86b4d2457965774f9dd6be9ce069d6ce (diff) | |
download | plus-3d2779c31490e4ac32bf72380703b9785b4e00be.tar.gz plus-3d2779c31490e4ac32bf72380703b9785b4e00be.tar.bz2 plus-3d2779c31490e4ac32bf72380703b9785b4e00be.tar.xz plus-3d2779c31490e4ac32bf72380703b9785b4e00be.zip |
Add support for change text in pet menu item "Return to egg".
Diffstat (limited to 'src/gui/popups')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 9c80415f6..8c43d1a20 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -390,9 +390,20 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being) // TRANSLATORS: pet rename item mBrowserBox->addRow("/setpetname", _("Rename")); mBrowserBox->addRow("##3---"); - // TRANSLATORS: popup menu item - // TRANSLATORS: pet return to egg - mBrowserBox->addRow("pet to egg", _("Return to egg")); + const BeingInfo *const info = being->getInfo(); + std::string msg; + if (info) + msg = info->getString(0); + if (!msg.empty()) + { + mBrowserBox->addRow("pet to egg", msg.c_str()); + } + else + { + // TRANSLATORS: popup menu item + // TRANSLATORS: pet return to egg + mBrowserBox->addRow("pet to egg", _("Return to egg")); + } mBrowserBox->addRow("##3---"); } else |