diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-18 22:05:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-18 22:05:19 +0300 |
commit | 9f2993aaa89a4a837455e78a4e00826a779b036c (patch) | |
tree | c36c593f320c9590a04b0791d1239ae4ebb94f57 /src/gui/popups/popupmenu.cpp | |
parent | 215ce3e68738159ec98056874a4ad86e451418d0 (diff) | |
download | plus-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.gz plus-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.bz2 plus-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.xz plus-9f2993aaa89a4a837455e78a4e00826a779b036c.zip |
Add baic menu into social window menu button.
Allow create/leave party or guild.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index fc3a52a77..0630e7844 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -3390,6 +3390,103 @@ void PopupMenu::showAdoptCommands() mBrowserBox->addRow("/adoptchild 'NAME'", _("Adopt child")); } +void PopupMenu::addSocialMenu() +{ + mBrowserBox->clearRows(); + setMousePos(); + const Party *const party = localPlayer->getParty(); + if (party) + { + // TRANSLATORS: popup menu item + // TRANSLATORS: leave party + mBrowserBox->addRow("/leaveparty", _("Leave party")); + } + else + { + // TRANSLATORS: popup menu item + // TRANSLATORS: create party + mBrowserBox->addRow("/createparty", _("Create party")); + } + const Guild *const guild = localPlayer->getGuild(); + if (!guild) + { + // TRANSLATORS: popup menu item + // TRANSLATORS: create guild + mBrowserBox->addRow("/createguild", _("Create guild")); + } + mBrowserBox->addRow("##3---"); +} + +void PopupMenu::showPartyPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showGuildPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showAttackPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showNavigationPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showPickupPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showPlayersPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + +void PopupMenu::showFriendsPopup() +{ + addSocialMenu(); + + // TRANSLATORS: popup menu item + // TRANSLATORS: close menu + mBrowserBox->addRow("cancel", _("Cancel")); + showPopup(mX, mY); +} + void PopupMenu::moveUp() { mBrowserBox->moveSelectionUp(); @@ -3402,5 +3499,6 @@ void PopupMenu::moveDown() void PopupMenu::select() { + mBrowserBox->selectSelection(); } |