diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-20 00:41:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-20 00:41:19 +0300 |
commit | cefe3bc037ccbf3f82b387d0484e9c81bed670f3 (patch) | |
tree | 8c953d209d8a0940f27af4e4c0ad4ff2177c7dc2 | |
parent | 32485e465199c587f73700f70a5a912ab5661205 (diff) | |
download | manaverse-cefe3bc037ccbf3f82b387d0484e9c81bed670f3.tar.gz manaverse-cefe3bc037ccbf3f82b387d0484e9c81bed670f3.tar.bz2 manaverse-cefe3bc037ccbf3f82b387d0484e9c81bed670f3.tar.xz manaverse-cefe3bc037ccbf3f82b387d0484e9c81bed670f3.zip |
Add adopt child into players context menu.
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 14 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.h | 2 |
2 files changed, 16 insertions, 0 deletions
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(); diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 5f4f6be70..b69a0f588 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -241,6 +241,8 @@ class PopupMenu final : public Popup, public LinkHandler void showMonsterGMCommands(); + void showAdoptCommands(); + bool addBeingMenu(); BrowserBox *mBrowserBox A_NONNULLPOINTER; |