From cefe3bc037ccbf3f82b387d0484e9c81bed670f3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Mar 2016 00:41:19 +0300 Subject: Add adopt child into players context menu. --- src/gui/popups/popupmenu.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gui/popups/popupmenu.cpp') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 811efc881..1ab1f4243 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -565,6 +565,7 @@ void PopupMenu::showPlayerPopup(const std::string &nick) mBrowserBox->addRow("##3---"); const PartyMember *const o = party->getMember( localPlayer->getName()); + showAdoptCommands(); if (o && member->getMap() == o->getMap()) { // TRANSLATORS: popup menu item @@ -2568,6 +2569,7 @@ void PopupMenu::addPartyName(const std::string &partyName) // TRANSLATORS: popup menu item // TRANSLATORS: kick player from party mBrowserBox->addRow("/kickparty 'NAME'", _("Kick from party")); + showAdoptCommands(); } mBrowserBox->addRow("##3---"); } @@ -2592,6 +2594,7 @@ void PopupMenu::addParty(const std::string &nick) // TRANSLATORS: popup menu item // TRANSLATORS: kick player from party mBrowserBox->addRow("/kickparty 'NAME'", _("Kick from party")); + showAdoptCommands(); } mBrowserBox->addRow("##3---"); } @@ -3198,6 +3201,17 @@ void PopupMenu::addCatchPetCommands() #endif } +void PopupMenu::showAdoptCommands() +{ +#ifdef EATHENA_SUPPORT + if (!serverFeatures->haveFamily()) + return; + // TRANSLATORS: popup menu item + // TRANSLATORS: adopt child command + mBrowserBox->addRow("/adoptchild 'NAME'", _("Adopt child")); +#endif +} + void PopupMenu::moveUp() { mBrowserBox->moveSelectionUp(); -- cgit v1.2.3-70-g09d2