summaryrefslogtreecommitdiff
path: root/src/gui/windows/socialwindow.cpp
diff options
context:
space:
mode:
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)