summaryrefslogtreecommitdiff
path: root/src/gui/popups
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-18 22:05:19 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-18 22:05:19 +0300
commit9f2993aaa89a4a837455e78a4e00826a779b036c (patch)
treec36c593f320c9590a04b0791d1239ae4ebb94f57 /src/gui/popups
parent215ce3e68738159ec98056874a4ad86e451418d0 (diff)
downloadplus-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')
-rw-r--r--src/gui/popups/popupmenu.cpp98
-rw-r--r--src/gui/popups/popupmenu.h16
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;