summaryrefslogtreecommitdiff
path: root/src/gui/windows/socialwindow.cpp
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/windows/socialwindow.cpp
parent215ce3e68738159ec98056874a4ad86e451418d0 (diff)
downloadManaVerse-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.gz
ManaVerse-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.bz2
ManaVerse-9f2993aaa89a4a837455e78a4e00826a779b036c.tar.xz
ManaVerse-9f2993aaa89a4a837455e78a4e00826a779b036c.zip
Add baic menu into social window menu button.
Allow create/leave party or guild.
Diffstat (limited to 'src/gui/windows/socialwindow.cpp')
-rw-r--r--src/gui/windows/socialwindow.cpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 2d53536bd..52507a422 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -21,6 +21,8 @@
#include "gui/windows/socialwindow.h"
+#include "gui/popups/popupmenu.h"
+
#include "gui/windows/okdialog.h"
#include "gui/windows/setupwindow.h"
@@ -70,7 +72,7 @@ SocialWindow::SocialWindow() :
mFriends(new SocialFriendsTab(this, _("F"),
getOptionBool("showtabbackground"))),
// TRANSLATORS: social window button
- mCreateButton(new Button(this, _("Create"), "create", this)),
+ mMenuButton(new Button(this, _("Menu"), "menu", this)),
mCountLabel(new Label(this, "1000 / 1000")),
mTabs(CREATEWIDGETR(TabbedArea, this)),
mMap(nullptr),
@@ -98,7 +100,7 @@ void SocialWindow::postInit()
if (setupWindow)
setupWindow->registerWindowForReset(this);
- place(0, 0, mCreateButton);
+ place(0, 0, mMenuButton);
place(0, 1, mCountLabel);
place(0, 2, mTabs, 2, 4);
@@ -322,6 +324,34 @@ void SocialWindow::action(const ActionEvent &event)
mGuildInvited = 0;
mGuildAcceptDialog = nullptr;
}
+ else if (eventId == "party")
+ {
+ popupMenu->showPartyPopup();
+ }
+ else if (eventId == "guild")
+ {
+ popupMenu->showGuildPopup();
+ }
+ else if (eventId == "attack")
+ {
+ popupMenu->showAttackPopup();
+ }
+ else if (eventId == "friends")
+ {
+ popupMenu->showFriendsPopup();
+ }
+ else if (eventId == "navigation")
+ {
+ popupMenu->showNavigationPopup();
+ }
+ else if (eventId == "pickup")
+ {
+ popupMenu->showPickupPopup();
+ }
+ else if (eventId == "players")
+ {
+ popupMenu->showPlayersPopup();
+ }
}
void SocialWindow::showGuildInvite(const std::string &restrict guildName,
@@ -560,16 +590,23 @@ void SocialWindow::widgetResized(const Event &event)
mTabs->adjustSize();
}
-void SocialWindow::setCounter(const SocialTab *const tab,
- const std::string &str)
+void SocialWindow::updateCounter(const SocialTab *const tab,
+ const std::string &counter)
{
if (mTabs->getSelectedTab() == tab)
{
- mCountLabel->setCaption(str);
+ mCountLabel->setCaption(counter);
mCountLabel->adjustSize();
}
}
+void SocialWindow::updateMenu(const SocialTab *const tab,
+ const std::string &menu)
+{
+ if (mTabs->getSelectedTab() == tab)
+ mMenuButton->setActionEventId(menu);
+}
+
void SocialWindow::updateGuildCounter(const int online, const int total)
{
if (!localPlayer)