diff options
Diffstat (limited to 'src/gui/popups')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 98 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.h | 16 |
2 files changed, 114 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(); } diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 7bd4c085e..9ea2c33b7 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -174,6 +174,20 @@ class PopupMenu final : public Popup, public LinkHandler void showEmoteType(); + void showPartyPopup(); + + void showGuildPopup(); + + void showAttackPopup(); + + void showNavigationPopup(); + + void showPickupPopup(); + + void showPlayersPopup(); + + void showFriendsPopup(); + /** * Handles link action. */ @@ -250,6 +264,8 @@ class PopupMenu final : public Popup, public LinkHandler void showAdoptCommands(); + void addSocialMenu(); + bool addBeingMenu(); BrowserBox *mBrowserBox A_NONNULLPOINTER; |