ManaPlus
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

#include <socialwindow.h>

Inheritance diagram for SocialWindow:
Window ActionListener PlayerRelationsListener BasicContainer2 MouseListener WidgetListener BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 SocialWindow ()
 
 ~SocialWindow ()
 
void postInit ()
 
bool addTab (Guild *const guild)
 
bool removeTab (Guild *const guild)
 
bool addTab (Party *const party)
 
bool removeTab (Party *const party)
 
void action (const ActionEvent &event)
 
void showGuildInvite (const std::string &guildName, const int guildId, const std::string &inviterName)
 
void showPartyInvite (const std::string &partyName, const std::string &inviter, const int partyId)
 
void updateActiveList ()
 
void updateAvatar (const std::string &name)
 
void resetDamage (const std::string &name)
 
void slowLogic ()
 
void updatePortals ()
 
void updatePortalNames ()
 
void updateParty ()
 
int getPortalIndex (const int x, const int y)
 
void addPortal (const int x, const int y)
 
void removePortal (const int x, const int y)
 
void nextTab ()
 
void prevTab ()
 
const MapgetMap () const
 
void setMap (Map *const map)
 
bool getProcessedPortals () const
 
void setProcessedPortals (const bool n)
 
void selectPortal (const unsigned num)
 
void updateAttackFilter ()
 
void updatePickupFilter ()
 
void widgetResized (const Event &event)
 
void updateCounter (const SocialTab *const tab, const std::string &count)
 
void updateMenu (const SocialTab *const tab, const std::string &menu)
 
void updateGuildCounter (const int online=0, const int total=0)
 
void updatedPlayer (const std::string &name)
 
void updateAll ()
 
- Public Member Functions inherited from Window
 Window (const std::string &caption="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
 
virtual ~Window ()
 
void draw (Graphics *const graphics)
 
void safeDraw (Graphics *const graphics)
 
void setContentSize (int width, int height)
 
void setLocationRelativeTo (const Widget *const widget)
 
void setLocationHorisontallyRelativeTo (const Widget *const widget)
 
void setLocationRelativeTo (const ImagePosition::Type &position, int offsetX=0, int offsetY=0)
 
void setResizable (const bool resize)
 
void redraw ()
 
void widgetMoved (const Event &event)
 
void widgetHidden (const Event &event)
 
void setCloseButton (const bool flag)
 
bool getCloseButton () const
 
void setAllowClose (const bool b)
 
bool getAlowClose () const
 
bool isResizable () const
 
void setMinWidth (const int width)
 
int getMinWidth () const
 
void setMinHeight (const int height)
 
int getMinHeight () const
 
void setMaxWidth (const int width)
 
int getMaxWidth () const
 
void setMaxHeight (const int height)
 
int getMaxHeight () const
 
void setShowTitle (bool flag)
 
void setStickyButton (const bool flag)
 
void setSticky (const bool sticky)
 
bool isSticky () const
 
void setStickyButtonLock (const bool sticky)
 
bool isStickyButtonLock () const
 
virtual void setVisible (Visible visible)
 
void setVisible (const Visible visible, const bool forceSticky)
 
bool isDefaultVisible () const
 
void setDefaultVisible (const bool save)
 
bool willSaveVisible () const
 
void setSaveVisible (const bool save)
 
WindowgetParentWindow () const
 
virtual void scheduleDelete ()
 
void mousePressed (MouseEvent &event)
 
void mouseDragged (MouseEvent &event)
 
void mouseMoved (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseExited (MouseEvent &event)
 
void mouseEntered (MouseEvent &event)
 
void updateResizeHandler (MouseEvent &event)
 
void setWindowName (const std::string &name)
 
const std::string & getWindowName () const
 
void loadWindowState ()
 
void saveWindowState ()
 
void setDefaultSize (const int defaultX, const int defaultY, int defaultWidth, int defaultHeight)
 
void setDefaultSize ()
 
void setDefaultSize (const int defaultWidth, const int defaultHeight, const ImagePosition::Type &position, const int offsetx=0, const int offsetY=0)
 
virtual void resetToDefaultSize ()
 
void adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight)
 
LayoutgetLayout ()
 
void clearLayout ()
 
void reflowLayout (int w=0, int h=0)
 
LayoutCellplace (const int x, const int y, Widget *const wg, const int w=1, const int h=1)
 
ContainerPlacer getPlacer (const int x, const int y)
 
void center ()
 
void centerHorisontally ()
 
virtual void close ()
 
void setModal (const Modal modal)
 
Rect getWindowArea () const
 
bool isResizeAllowed (const MouseEvent &event) const
 
void setCaptionFont (Font *font)
 
void enableVisibleSound (bool b)
 
bool isWindowVisible () const
 
void setPadding (int padding)
 
int getPadding () const
 
void setTitleBarHeight (unsigned int height)
 
unsigned int getTitleBarHeight () const
 
void setCaption (const std::string &caption)
 
const std::string & getCaption () const
 
void setAlignment (Graphics::Alignment alignment)
 
Graphics::Alignment getAlignment () const
 
void setMovable (Move movable)
 
bool isMovable () const
 
Rect getChildrenArea ()
 
virtual void resizeToContent ()
 
- Public Member Functions inherited from BasicContainer2
 BasicContainer2 (const Widget2 *const widget)
 
virtual ~BasicContainer2 ()
 
void setOpaque (Opaque opaque)
 
bool isOpaque () const
 
virtual void add (Widget *const widget)
 
void addXY (Widget *const widget, const int x, const int y)
 
- Public Member Functions inherited from BasicContainer
 BasicContainer (const Widget2 *const widget)
 
virtual ~BasicContainer ()
 
void showWidgetPart (Widget *const widget, const Rect &area)
 
void moveToTop (Widget *const widget)
 
void moveToBottom (Widget *const widget)
 
void focusNext ()
 
void focusPrevious ()
 
void logic ()
 
void setFocusHandler (FocusHandler *const focusHandler)
 
void setInternalFocusHandler (FocusHandler *const focusHandler)
 
WidgetgetWidgetAt (int x, int y)
 
void death (const Event &event)
 
WidgetfindFirstWidget (const std::set< Widget *> &list)
 
void add (Widget *const widget)
 
virtual void remove (Widget *const widget)
 
virtual void clear ()
 
- Public Member Functions inherited from Widget
 Widget (const Widget2 *const widget)
 
virtual ~Widget ()
 
virtual void drawFrame (Graphics *graphics)
 
virtual void safeDrawFrame (Graphics *graphics)
 
void setFrameSize (const unsigned int frameSize)
 
unsigned int getFrameSize () const
 
WidgetgetParent () const
 
void setWidth (const int width)
 
int getWidth () const
 
void setHeight (const int height)
 
int getHeight () const
 
void setSize (const int width, const int height)
 
void setX (const int x)
 
int getX () const
 
void setY (const int y)
 
int getY () const
 
void setPosition (const int x, const int y)
 
void setDimension (const Rect &dimension)
 
const RectgetDimension () const
 
void setFocusable (const bool focusable)
 
bool isFocusable () const
 
virtual bool isFocused () const
 
void setEnabled (const bool enabled)
 
bool isEnabled () const
 
void setVisible (Visible visible)
 
bool isVisible () const
 
void setBaseColor (const Color &color)
 
const ColorgetBaseColor () const
 
void setForegroundColor (const Color &color)
 
const ColorgetForegroundColor () const
 
void setBackgroundColor (const Color &color)
 
const ColorgetBackgroundColor () const
 
virtual void requestFocus ()
 
virtual void requestMoveToTop ()
 
virtual void requestMoveToBottom ()
 
FocusHandlergetFocusHandler ()
 
void addActionListener (ActionListener *const actionListener)
 
void removeActionListener (ActionListener *const actionListener)
 
void addDeathListener (WidgetDeathListener *const deathListener)
 
void removeDeathListener (WidgetDeathListener *const deathListener)
 
void addMouseListener (MouseListener *const mouseListener)
 
void removeMouseListener (MouseListener *const mouseListener)
 
void addKeyListener (KeyListener *const keyListener)
 
void removeKeyListener (KeyListener *const keyListener)
 
void addFocusListener (FocusListener *const focusListener)
 
void removeFocusListener (FocusListener *const focusListener)
 
void addWidgetListener (WidgetListener *const widgetListener)
 
void removeWidgetListener (WidgetListener *const widgetListener)
 
void setActionEventId (const std::string &actionEventId)
 
const std::string & getActionEventId () const
 
virtual void getAbsolutePosition (int &x, int &y) const
 
virtual void setParent (Widget *parent)
 
FontgetFont () const
 
void setFont (Font *const font)
 
virtual void fontChanged ()
 
bool isTabInEnabled () const
 
void setTabInEnabled (const bool enabled)
 
bool isTabOutEnabled () const
 
void setTabOutEnabled (const bool enabled)
 
void requestModalFocus ()
 
virtual void requestModalMouseInputFocus ()
 
virtual void releaseModalFocus ()
 
virtual void releaseModalMouseInputFocus ()
 
virtual bool isModalFocused () const
 
virtual bool isModalMouseInputFocused () const
 
const std::list< MouseListener * > & getMouseListeners () const A_CONST
 
const std::list< KeyListener * > & getKeyListeners () const A_CONST
 
const std::list< FocusListener * > & getFocusListeners () const A_CONST
 
virtual FocusHandlergetInternalFocusHandler ()
 
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
 
void setId (const std::string &id)
 
const std::string & getId () const
 
virtual void showPart (const Rect &rectangle)
 
bool isAllowLogic () const
 
void setMouseConsume (const bool b)
 
bool isMouseConsume () const
 
void setRedraw (const bool b)
 
virtual bool isSelectable () const
 
void setSelectable (const bool selectable)
 
void windowResized ()
 
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
 
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha=255U) const A_INLINE
 
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
 
virtual void setWidget2 (const Widget2 *const widget)
 
void setPalette (int palette)
 
void checkPalette ()
 
void setForegroundColor2 (const Color &color)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 
- Public Member Functions inherited from WidgetDeathListener
virtual ~WidgetDeathListener ()
 
- Public Member Functions inherited from MouseListener
virtual ~MouseListener ()
 
virtual void mouseClicked (MouseEvent &event)
 
virtual void mouseWheelMovedUp (MouseEvent &event)
 
virtual void mouseWheelMovedDown (MouseEvent &event)
 
- Public Member Functions inherited from WidgetListener
virtual ~WidgetListener ()
 
virtual void widgetShown (const Event &event)
 
- Public Member Functions inherited from PlayerRelationsListener
virtual ~PlayerRelationsListener ()
 

Protected Types

typedef std::map< Guild *, SocialTab * > GuildMap
 
typedef std::map< Party *, SocialTab * > PartyMap
 
- Protected Types inherited from BasicContainer
typedef std::vector< Widget * > WidgetList
 
typedef WidgetList::iterator WidgetListIterator
 
typedef WidgetList::const_iterator WidgetListConstIterator
 
typedef WidgetList::reverse_iterator WidgetListReverseIterator
 
typedef WidgetList::const_reverse_iterator WidgetListCReverseIterator
 
- Protected Types inherited from Widget
typedef std::list< MouseListener * > MouseListenerList
 
typedef MouseListenerList::iterator MouseListenerIterator
 
typedef std::list< KeyListener * > KeyListenerList
 
typedef KeyListenerList::iterator KeyListenerIterator
 
typedef std::list< ActionListener * > ActionListenerList
 
typedef ActionListenerList::iterator ActionListenerIterator
 
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
 
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
 
typedef std::list< FocusListener * > FocusListenerList
 
typedef FocusListenerList::iterator FocusListenerIterator
 
typedef std::list< WidgetListener * > WidgetListenerList
 
typedef WidgetListenerList::iterator WidgetListenerIterator
 

Protected Member Functions

void updateButtons ()
 
- Protected Member Functions inherited from Window
bool canMove () const
 
int getOption (const std::string &name, const int def=0) const
 
bool getOptionBool (const std::string &name, const bool def=false) const
 
void setTitlePadding (const int p)
 
int getTitlePadding () const
 
- Protected Member Functions inherited from BasicContainer
virtual void drawChildren (Graphics *const graphics)
 
virtual void safeDrawChildren (Graphics *const graphics)
 
virtual void logicChildren ()
 
- Protected Member Functions inherited from Widget
void distributeActionEvent ()
 
void distributeResizedEvent ()
 
void distributeMovedEvent ()
 
void distributeHiddenEvent ()
 
void distributeShownEvent ()
 
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
 
- Protected Member Functions inherited from WidgetDeathListener
 WidgetDeathListener ()
 
- Protected Member Functions inherited from MouseListener
 MouseListener ()
 
- Protected Member Functions inherited from WidgetListener
 WidgetListener ()
 
- Protected Member Functions inherited from PlayerRelationsListener
 PlayerRelationsListener ()
 

Protected Attributes

int mGuildInvited
 
ConfirmDialogmGuildAcceptDialog
 
TextDialogmGuildCreateDialog
 
std::string mPartyInviter
 
GuildMap mGuilds
 
PartyMap mParties
 
ConfirmDialogmPartyAcceptDialog
 
SocialTabmAttackFilter
 
SocialTabmPickupFilter
 
SocialTabmPlayers
 
SocialTabmNavigation
 
SocialTabmFriends
 
ButtonmMenuButton
 
LabelmCountLabel
 
TabbedAreamTabs
 
MapmMap
 
time_t mLastUpdateTime
 
int mPartyId
 
bool mNeedUpdate
 
bool mProcessedPortals
 
- Protected Attributes inherited from Window
std::string mCaption
 
Graphics::Alignment mAlignment
 
int mPadding
 
unsigned int mTitleBarHeight
 
Move mMovable
 
int mDragOffsetX
 
int mDragOffsetY
 
bool mMoved
 
SkinmSkin
 
int mDefaultX
 
int mDefaultY
 
int mDefaultWidth
 
int mDefaultHeight
 
int mCaptionOffsetX
 
int mCaptionOffsetY
 
bool mShowTitle
 
bool mLastRedraw
 
- Protected Attributes inherited from BasicContainer2
Opaque mOpaque
 
- Protected Attributes inherited from BasicContainer
WidgetList mWidgets
 
WidgetList mLogicWidgets
 
- Protected Attributes inherited from Widget
MouseListenerList mMouseListeners
 
KeyListenerList mKeyListeners
 
ActionListenerList mActionListeners
 
WidgetDeathListenerList mDeathListeners
 
FocusListenerList mFocusListeners
 
WidgetListenerList mWidgetListeners
 
Color mForegroundColor
 
Color mBackgroundColor
 
Color mBaseColor
 
Rect mDimension
 
std::string mActionEventId
 
std::string mId
 
FocusHandlermFocusHandler
 
FocusHandlermInternalFocusHandler
 
WidgetmParent
 
FontmCurrentFont
 
unsigned int mFrameSize
 
bool mFocusable
 
bool mTabIn
 
bool mTabOut
 
bool mEnabled
 
bool mAllowLogic
 
bool mMouseConsume
 
bool mRedraw
 
bool mSelectable
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 

Friends

class SocialTab
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *const windowContainer)
 
- Static Public Member Functions inherited from Widget
static void setGlobalFont (Font *const font)
 
static FontgetGloablFont ()
 
static void cleanGlobalFont ()
 
static bool widgetExists (const Widget *const widget)
 
static void distributeWindowResizeEvent ()
 
static WidgetcallPostInit (Widget *const widget)
 
- Data Fields inherited from Widget
Visible mVisible
 
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0
 
- Private Member Functions inherited from ActionListener
virtual ~ActionListener ()
 
 ActionListener ()
 

Detailed Description

Party window.

Definition at line 45 of file socialwindow.h.

Member Typedef Documentation

◆ GuildMap

typedef std::map<Guild*, SocialTab*> SocialWindow::GuildMap
protected

Definition at line 138 of file socialwindow.h.

◆ PartyMap

typedef std::map<Party*, SocialTab*> SocialWindow::PartyMap
protected

Definition at line 139 of file socialwindow.h.

Constructor & Destructor Documentation

◆ SocialWindow()

SocialWindow::SocialWindow ( )

Definition at line 50 of file socialwindow.cpp.

50  :
51  // TRANSLATORS: social window name
52  Window(_("Social"), Modal_false, nullptr, "social.xml"),
55  mGuildInvited(0),
56  mGuildAcceptDialog(nullptr),
57  mGuildCreateDialog(nullptr),
58  mPartyInviter(),
59  mGuilds(),
60  mParties(),
61  mPartyAcceptDialog(nullptr),
62  mAttackFilter(nullptr),
63  mPickupFilter(nullptr),
64  // TRANSLATORS: here P is title for visible players tab in social window
65  mPlayers(new SocialPlayersTab(this, _("P"),
66  fromBool(getOptionBool("showtabbackground"), Opaque))),
68  fromBool(getOptionBool("showtabbackground"), Opaque))),
69  // TRANSLATORS: here F is title for friends tab in social window
70  mFriends(new SocialFriendsTab(this, _("F"),
71  fromBool(getOptionBool("showtabbackground"), Opaque))),
72  // TRANSLATORS: social window button
73  mMenuButton(new Button(this, _("Menu"), "menu", this)),
74  mCountLabel(new Label(this, "1000 / 1000")),
76  mMap(nullptr),
77  mLastUpdateTime(0),
78  mPartyId(0),
79  mNeedUpdate(false),
80  mProcessedPortals(false)
81 {
82 }
#define _(s)
Definition: gettext.h:34
PartyMap mParties
Definition: socialwindow.h:148
Label * mCountLabel
Definition: socialwindow.h:159
SocialTab * mPickupFilter
Definition: socialwindow.h:153
SocialTab * mNavigation
Definition: socialwindow.h:155
Definition: button.h:94
bool getOptionBool(const std::string &name, const bool def=false) const
Definition: window.cpp:1454
GuildMap mGuilds
Definition: socialwindow.h:147
SocialTab * mFriends
Definition: socialwindow.h:156
bool mProcessedPortals
Definition: socialwindow.h:166
Definition: label.h:87
#define fromBool(val, name)
Definition: booldefines.h:48
ConfirmDialog * mGuildAcceptDialog
Definition: socialwindow.h:144
Button * mMenuButton
Definition: socialwindow.h:158
std::string mPartyInviter
Definition: socialwindow.h:146
TabbedArea * mTabs
Definition: socialwindow.h:160
time_t mLastUpdateTime
Definition: socialwindow.h:163
#define CREATEWIDGETR(type,...)
Definition: createwidget.h:35
SocialTab * mPlayers
Definition: socialwindow.h:154
SocialTab * mAttackFilter
Definition: socialwindow.h:152
Window(const std::string &caption="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
Definition: window.cpp:108
TextDialog * mGuildCreateDialog
Definition: socialwindow.h:145
ConfirmDialog * mPartyAcceptDialog
Definition: socialwindow.h:150

◆ ~SocialWindow()

SocialWindow::~SocialWindow ( )

Definition at line 149 of file socialwindow.cpp.

References Window::close(), delete2, FOR_EACH, mAttackFilter, mFriends, mGuildAcceptDialog, mGuildInvited, mGuilds, mNavigation, mParties, mPartyAcceptDialog, mPartyInviter, mPickupFilter, mPlayers, playerRelations, PlayerRelationsManager::removeListener(), and Window::scheduleDelete().

150 {
152  if (mGuildAcceptDialog != nullptr)
153  {
156  mGuildAcceptDialog = nullptr;
157 
158  mGuildInvited = 0;
159  }
160 
161  if (mPartyAcceptDialog != nullptr)
162  {
165  mPartyAcceptDialog = nullptr;
166 
167  mPartyInviter.clear();
168  }
169  delete2(mPlayers);
173  delete2(mFriends);
174  FOR_EACH (GuildMap::iterator, it, mGuilds)
175  {
176  delete (*it).second;
177  }
178  mGuilds.clear();
179  FOR_EACH (PartyMap::iterator, it, mParties)
180  {
181  delete (*it).second;
182  }
183  mParties.clear();
184 }
void removeListener(PlayerRelationsListener *const listener)
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
PartyMap mParties
Definition: socialwindow.h:148
SocialTab * mPickupFilter
Definition: socialwindow.h:153
SocialTab * mNavigation
Definition: socialwindow.h:155
GuildMap mGuilds
Definition: socialwindow.h:147
SocialTab * mFriends
Definition: socialwindow.h:156
#define delete2(var)
Definition: delete2.h:24
virtual void close()
Definition: window.cpp:890
ConfirmDialog * mGuildAcceptDialog
Definition: socialwindow.h:144
virtual void scheduleDelete()
Definition: window.cpp:819
std::string mPartyInviter
Definition: socialwindow.h:146
SocialTab * mPlayers
Definition: socialwindow.h:154
SocialTab * mAttackFilter
Definition: socialwindow.h:152
PlayerRelationsManager playerRelations
ConfirmDialog * mPartyAcceptDialog
Definition: socialwindow.h:150

Member Function Documentation

◆ action()

void SocialWindow::action ( const ActionEvent actionEvent)
virtual

Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.

Parameters
actionEventThe event of the action.

Implements ActionListener.

Definition at line 265 of file socialwindow.cpp.

References _, ChatMsgType::BY_SERVER, ChatTab::chatLog(), GuildManager::getEnableGuildBot(), Event::getSource(), guildHandler, guildManager, Net::GuildHandler::inviteResponse(), GuildManager::inviteResponse(), Net::PartyHandler::inviteResponse(), localChatTab, mGuildAcceptDialog, mGuildInvited, mPartyAcceptDialog, mPartyId, mPartyInviter, partyHandler, popupMenu, PopupMenu::showAttackPopup(), PopupMenu::showFriendsPopup(), PopupMenu::showGuildPopup(), PopupMenu::showNavigationPopup(), PopupMenu::showPartyPopup(), PopupMenu::showPickupPopup(), PopupMenu::showPlayersPopup(), and strprintf().

266 {
267  const std::string &eventId = event.getId();
268 
269  if (event.getSource() == mPartyAcceptDialog)
270  {
271  if (eventId == "yes")
272  {
273  if (localChatTab != nullptr)
274  {
276  // TRANSLATORS: chat message
277  strprintf(_("Accepted party invite from %s."),
278  mPartyInviter.c_str()),
280  }
282  }
283  else if (eventId == "no")
284  {
285  if (localChatTab != nullptr)
286  {
288  // TRANSLATORS: chat message
289  strprintf(_("Rejected party invite from %s."),
290  mPartyInviter.c_str()),
292  }
294  }
295 
296  mPartyInviter.clear();
297  mPartyAcceptDialog = nullptr;
298  }
299  else if (event.getSource() == mGuildAcceptDialog)
300  {
301  if (eventId == "yes")
302  {
303  if (localChatTab != nullptr)
304  {
306  // TRANSLATORS: chat message
307  strprintf(_("Accepted guild invite from %s."),
308  mPartyInviter.c_str()),
310  }
311 #ifdef TMWA_SUPPORT
312  if (guildManager == nullptr || !GuildManager::getEnableGuildBot())
314  else
316 #else // TMWA_SUPPORT
317 
319 #endif // TMWA_SUPPORT
320  }
321  else if (eventId == "no")
322  {
323  if (localChatTab != nullptr)
324  {
326  // TRANSLATORS: chat message
327  strprintf(_("Rejected guild invite from %s."),
328  mPartyInviter.c_str()),
330  }
331 #ifdef TMWA_SUPPORT
332  if (guildManager == nullptr || !GuildManager::getEnableGuildBot())
334  else
336 #else // TMWA_SUPPORT
337 
339 #endif // TMWA_SUPPORT
340  }
341 
342  mGuildInvited = 0;
343  mGuildAcceptDialog = nullptr;
344  }
345  else if (eventId == "party")
346  {
348  }
349  else if (eventId == "guild")
350  {
352  }
353  else if (eventId == "attack")
354  {
356  }
357  else if (eventId == "friends")
358  {
360  }
361  else if (eventId == "navigation")
362  {
364  }
365  else if (eventId == "pickup")
366  {
368  }
369  else if (eventId == "players")
370  {
372  }
373 }
void showPartyPopup()
Definition: popupmenu.cpp:3526
#define _(s)
Definition: gettext.h:34
ChatTab * localChatTab
Definition: chattab.cpp:61
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord=IgnoreRecord_false, const TryRemoveColors tryRemoveColors=TryRemoveColors_true)
Definition: chattab.cpp:109
static void inviteResponse(const bool response)
void showNavigationPopup()
Definition: popupmenu.cpp:3560
void showAttackPopup()
Definition: popupmenu.cpp:3550
Net::GuildHandler * guildHandler
Definition: net.cpp:85
void showPlayersPopup()
Definition: popupmenu.cpp:3580
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
PopupMenu * popupMenu
Definition: popupmenu.cpp:102
GuildManager * guildManager
static bool getEnableGuildBot()
Definition: guildmanager.h:55
ConfirmDialog * mGuildAcceptDialog
Definition: socialwindow.h:144
void showPickupPopup()
Definition: popupmenu.cpp:3570
void showGuildPopup()
Definition: popupmenu.cpp:3536
std::string mPartyInviter
Definition: socialwindow.h:146
void showFriendsPopup()
Definition: popupmenu.cpp:3590
Net::PartyHandler * partyHandler
Definition: net.cpp:87
virtual void inviteResponse(const int partyId, const bool accept) const =0
virtual void inviteResponse(const int guildId, const bool response) const =0
ConfirmDialog * mPartyAcceptDialog
Definition: socialwindow.h:150

◆ addPortal()

void SocialWindow::addPortal ( const int  x,
const int  y 
)

Definition at line 548 of file socialwindow.cpp.

References mNavigation.

Referenced by LocalPlayer::setHome().

549 {
550  if (mNavigation != nullptr)
551  static_cast<SocialNavigationTab*>(mNavigation)->addPortal(x, y);
552 }
SocialTab * mNavigation
Definition: socialwindow.h:155
void addPortal(const int x, const int y)

◆ addTab() [1/2]

bool SocialWindow::addTab ( Guild *const  guild)

Definition at line 186 of file socialwindow.cpp.

References TabbedArea::addTab(), fromBool, Window::getOptionBool(), Guild::getServerGuild(), guild, mGuilds, SocialTab::mScroll, mTabs, and updateButtons().

Referenced by Being::addGuild(), postInit(), Being::setGuild(), and Being::setParty().

187 {
188  if (guild == nullptr)
189  return false;
190 
191  if (mGuilds.find(guild) != mGuilds.end())
192  return false;
193 
194  SocialTab *tab = nullptr;
195  if (guild->getServerGuild())
196  {
197  tab = new SocialGuildTab(this, guild,
198  fromBool(getOptionBool("showtabbackground"), Opaque));
199  }
200 #ifdef TMWA_SUPPORT
201  else
202  {
203  tab = new SocialGuildTab2(this, guild,
204  fromBool(getOptionBool("showtabbackground"), Opaque));
205  }
206 #endif // TMWA_SUPPORT
207 
208  mGuilds[guild] = tab;
209  mTabs->addTab(tab, tab->mScroll);
210 
211  updateButtons();
212 
213  return true;
214 }
ScrollArea * mScroll
Definition: socialtab.h:137
bool getServerGuild() const
Definition: guild.h:198
bool getOptionBool(const std::string &name, const bool def=false) const
Definition: window.cpp:1454
GuildMap mGuilds
Definition: socialwindow.h:147
#define fromBool(val, name)
Definition: booldefines.h:48
TabbedArea * mTabs
Definition: socialwindow.h:160
void updateButtons()
uint32_t guild
void addTab(Tab *const tab, Widget *const widget)
Definition: tabbedarea.cpp:229

◆ addTab() [2/2]

bool SocialWindow::addTab ( Party *const  party)

Definition at line 231 of file socialwindow.cpp.

References TabbedArea::addTab(), fromBool, Window::getOptionBool(), mParties, SocialTab::mScroll, mTabs, party, and updateButtons().

232 {
233  if (party == nullptr)
234  return false;
235 
236  if (mParties.find(party) != mParties.end())
237  return false;
238 
239  SocialPartyTab *const tab = new SocialPartyTab(this, party,
240  fromBool(getOptionBool("showtabbackground"), Opaque));
241  mParties[party] = tab;
242 
243  mTabs->addTab(tab, tab->mScroll);
244 
245  updateButtons();
246 
247  return true;
248 }
PartyMap mParties
Definition: socialwindow.h:148
ScrollArea * mScroll
Definition: socialtab.h:137
bool getOptionBool(const std::string &name, const bool def=false) const
Definition: window.cpp:1454
uint32_t party
#define fromBool(val, name)
Definition: booldefines.h:48
TabbedArea * mTabs
Definition: socialwindow.h:160
void updateButtons()
void addTab(Tab *const tab, Widget *const widget)
Definition: tabbedarea.cpp:229

◆ getMap()

const Map* SocialWindow::getMap ( ) const
inline

◆ getPortalIndex()

int SocialWindow::getPortalIndex ( const int  x,
const int  y 
)

Definition at line 538 of file socialwindow.cpp.

References mNavigation.

Referenced by EAthena::BeingRecv::processBeingSpawn(), TmwAthena::BeingRecv::processBeingVisible(), EAthena::BeingRecv::processBeingVisible(), and LocalPlayer::setHome().

539 {
540  if (mNavigation != nullptr)
541  {
542  return static_cast<SocialNavigationTab*>(
544  }
545  return -1;
546 }
SocialTab * mNavigation
Definition: socialwindow.h:155
int getPortalIndex(const int x, const int y)

◆ getProcessedPortals()

bool SocialWindow::getProcessedPortals ( ) const
inline

Definition at line 106 of file socialwindow.h.

References mProcessedPortals.

Referenced by SocialNavigationTab::updateList().

107  { return mProcessedPortals; }
bool mProcessedPortals
Definition: socialwindow.h:166

◆ nextTab()

void SocialWindow::nextTab ( )

Definition at line 560 of file socialwindow.cpp.

References mTabs, and TabbedArea::selectNextTab().

561 {
562  if (mTabs != nullptr)
563  mTabs->selectNextTab();
564 }
TabbedArea * mTabs
Definition: socialwindow.h:160
void selectNextTab()
Definition: tabbedarea.cpp:808

◆ postInit()

void SocialWindow::postInit ( )
virtual

Reimplemented from Window.

Definition at line 84 of file socialwindow.cpp.

References PlayerRelationsManager::addListener(), addTab(), TabbedArea::addTab(), config, Window::enableVisibleSound(), fromBool, Configuration::getBoolValue(), Being::getGuild(), Window::getOptionBool(), Being::getParty(), TabbedArea::getTabContainer(), TabbedArea::getWidgetContainer(), Window::loadWindowState(), localPlayer, mAttackFilter, mCountLabel, mFriends, mMenuButton, mNavigation, mPickupFilter, mPlayers, SocialTab::mScroll, mTabs, Window::place(), playerRelations, Window::postInit(), SetupWindow::registerWindowForReset(), Window::setCloseButton(), Window::setDefaultSize(), Window::setMinHeight(), Window::setMinWidth(), Window::setResizable(), Window::setSaveVisible(), Widget::setSelectable(), Window::setStickyButtonLock(), setupWindow, Window::setVisible(), Window::setWindowName(), updateButtons(), Visible_false, and widgetResized().

85 {
87  setWindowName("Social");
89  setSaveVisible(true);
90  setResizable(true);
91  setSaveVisible(true);
92  setCloseButton(true);
93  setStickyButtonLock(true);
94 
95  setMinWidth(120);
96  setMinHeight(55);
97  setDefaultSize(590, 200, 180, 300);
98  if (setupWindow != nullptr)
100 
101  place(0, 0, mMenuButton);
102  place(0, 1, mCountLabel);
103  place(0, 2, mTabs, 2, 4);
104 
105  widgetResized(Event(nullptr));
106 
107  loadWindowState();
108 
112  mTabs->setSelectable(false);
115 
116  if (config.getBoolValue("enableAttackFilter"))
117  {
118  mAttackFilter = new SocialAttackTab(this,
119  fromBool(getOptionBool("showtabbackground"), Opaque));
121  }
122  else
123  {
124  mAttackFilter = nullptr;
125  }
126 
127  if (config.getBoolValue("enablePickupFilter"))
128  {
129  mPickupFilter = new SocialPickupTab(this,
130  fromBool(getOptionBool("showtabbackground"), Opaque));
132  }
133  else
134  {
135  mPickupFilter = nullptr;
136  }
137 
138  if ((localPlayer != nullptr) && (localPlayer->getParty() != nullptr))
140 
141  if ((localPlayer != nullptr) && (localPlayer->getGuild() != nullptr))
143 
144  enableVisibleSound(true);
145  updateButtons();
147 }
void setDefaultSize()
Definition: window.cpp:1186
Label * mCountLabel
Definition: socialwindow.h:159
void loadWindowState()
Definition: window.cpp:1075
SocialTab * mPickupFilter
Definition: socialwindow.h:153
const Guild * getGuild(const std::string &guildName) const
Definition: being.cpp:1219
ScrollArea * mScroll
Definition: socialtab.h:137
void setMinWidth(const int width)
Definition: window.cpp:579
void addListener(PlayerRelationsListener *const listener)
SocialTab * mNavigation
Definition: socialwindow.h:155
Configuration config
bool getOptionBool(const std::string &name, const bool def=false) const
Definition: window.cpp:1454
SocialTab * mFriends
Definition: socialwindow.h:156
Party * getParty() const
Definition: being.h:325
bool addTab(Guild *const guild)
void registerWindowForReset(Window *const window)
void setSelectable(const bool selectable)
Definition: widget.h:947
Widget * getWidgetContainer() const
Definition: tabbedarea.h:243
bool getBoolValue(const std::string &key) const
Widget * getTabContainer() const
Definition: tabbedarea.h:240
const bool Visible_false
Definition: visible.h:29
#define fromBool(val, name)
Definition: booldefines.h:48
LayoutCell & place(const int x, const int y, Widget *const wg, const int w=1, const int h=1)
Definition: window.cpp:1372
LocalPlayer * localPlayer
void setCloseButton(const bool flag)
Definition: window.cpp:737
Button * mMenuButton
Definition: socialwindow.h:158
void enableVisibleSound(bool b)
Definition: window.h:473
void setMinHeight(const int height)
Definition: window.cpp:592
void setSaveVisible(const bool save)
Definition: window.h:298
virtual void setVisible(Visible visible)
Definition: window.cpp:766
TabbedArea * mTabs
Definition: socialwindow.h:160
Definition: event.h:77
void updateButtons()
void setResizable(const bool resize)
Definition: window.cpp:615
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:760
SetupWindow * setupWindow
Definition: setupwindow.cpp:63
SocialTab * mPlayers
Definition: socialwindow.h:154
SocialTab * mAttackFilter
Definition: socialwindow.h:152
PlayerRelationsManager playerRelations
void postInit()
Definition: window.cpp:241
void addTab(Tab *const tab, Widget *const widget)
Definition: tabbedarea.cpp:229
void setWindowName(const std::string &name)
Definition: window.h:353
void widgetResized(const Event &event)

◆ prevTab()

void SocialWindow::prevTab ( )

Definition at line 566 of file socialwindow.cpp.

References mTabs, and TabbedArea::selectPrevTab().

567 {
568  if (mTabs != nullptr)
569  mTabs->selectPrevTab();
570 }
void selectPrevTab()
Definition: tabbedarea.cpp:817
TabbedArea * mTabs
Definition: socialwindow.h:160

◆ removePortal()

void SocialWindow::removePortal ( const int  x,
const int  y 
)

Definition at line 554 of file socialwindow.cpp.

References mNavigation.

Referenced by PopupMenu::handleLink(), and LocalPlayer::setHome().

555 {
556  if (mNavigation != nullptr)
557  static_cast<SocialNavigationTab*>(mNavigation)->removePortal(x, y);
558 }
SocialTab * mNavigation
Definition: socialwindow.h:155
void removePortal(const int x, const int y)

◆ removeTab() [1/2]

bool SocialWindow::removeTab ( Guild *const  guild)

Definition at line 216 of file socialwindow.cpp.

References mGuilds, mTabs, TabbedArea::removeTab(), and updateButtons().

Referenced by GuildManager::afterRemove(), GuildManager::clear(), Being::clearGuilds(), TmwAthena::GeneralHandler::gameEnded(), EAthena::GeneralHandler::gameEnded(), EAthena::GuildRecv::processGuildExpulsionContinue(), EAthena::GuildRecv::processGuildLeave(), Ea::PartyRecv::processPartyLeave(), GuildManager::reload(), Being::removeGuild(), Being::setGuild(), and Being::setParty().

217 {
218  const GuildMap::iterator it = mGuilds.find(guild);
219  if (it == mGuilds.end())
220  return false;
221 
222  mTabs->removeTab(it->second);
223  delete it->second;
224  mGuilds.erase(it);
225 
226  updateButtons();
227 
228  return true;
229 }
void removeTab(Tab *const tab)
Definition: tabbedarea.cpp:314
GuildMap mGuilds
Definition: socialwindow.h:147
TabbedArea * mTabs
Definition: socialwindow.h:160
void updateButtons()

◆ removeTab() [2/2]

bool SocialWindow::removeTab ( Party *const  party)

Definition at line 250 of file socialwindow.cpp.

References mParties, mTabs, TabbedArea::removeTab(), and updateButtons().

251 {
252  const PartyMap::iterator it = mParties.find(party);
253  if (it == mParties.end())
254  return false;
255 
256  mTabs->removeTab(it->second);
257  delete it->second;
258  mParties.erase(it);
259 
260  updateButtons();
261 
262  return true;
263 }
PartyMap mParties
Definition: socialwindow.h:148
void removeTab(Tab *const tab)
Definition: tabbedarea.cpp:314
TabbedArea * mTabs
Definition: socialwindow.h:160
void updateButtons()

◆ resetDamage()

void SocialWindow::resetDamage ( const std::string &  name)

Definition at line 507 of file socialwindow.cpp.

References mPlayers, and SocialTab::resetDamage().

Referenced by TmwAthena::BeingRecv::processBeingSelfEffect(), and EAthena::BeingRecv::processBeingSpecialEffect().

508 {
509  mPlayers->resetDamage(name);
510 }
virtual void resetDamage(const std::string &name)
Definition: socialtab.h:61
SocialTab * mPlayers
Definition: socialwindow.h:154

◆ selectPortal()

void SocialWindow::selectPortal ( const unsigned  num)

Definition at line 532 of file socialwindow.cpp.

References mNavigation, and SocialTab::selectIndex().

Referenced by Actions::closeMoveNpcDialog(), and setProcessedPortals().

533 {
534  if (mNavigation != nullptr)
535  mNavigation->selectIndex(num);
536 }
SocialTab * mNavigation
Definition: socialwindow.h:155
virtual void selectIndex(const unsigned num)
Definition: socialtab.h:65

◆ setMap()

void SocialWindow::setMap ( Map *const  map)
inline

Definition at line 103 of file socialwindow.h.

References mMap, and mProcessedPortals.

Referenced by Game::changeMap().

104  { mMap = map; mProcessedPortals = false; }
bool mProcessedPortals
Definition: socialwindow.h:166

◆ setProcessedPortals()

void SocialWindow::setProcessedPortals ( const bool  n)
inline

◆ showGuildInvite()

void SocialWindow::showGuildInvite ( const std::string &  guildName,
const int  guildId,
const std::string &  inviterName 
)

Definition at line 375 of file socialwindow.cpp.

References _, Widget::addActionListener(), ChatMsgType::BY_SERVER, ChatTab::chatLog(), CREATEWIDGETV, localChatTab, mGuildAcceptDialog, mGuildInvited, Modal_false, Actions::msg(), SOUND_REQUEST, and strprintf().

Referenced by GuildManager::process(), and EAthena::GuildRecv::processGuildInvite().

378 {
379  // check there isnt already an invite showing
380  if (mGuildInvited != 0)
381  {
382  if (localChatTab != nullptr)
383  {
384  // TRANSLATORS: chat message
385  localChatTab->chatLog(_("Received guild request, but one already "
386  "exists."),
388  }
389  return;
390  }
391 
392  const std::string msg = strprintf(
393  // TRANSLATORS: chat message
394  _("%s has invited you to join the guild %s."),
395  inviterName.c_str(), guildName.c_str());
396 
397  if (localChatTab != nullptr)
399 
401  // TRANSLATORS: guild invite message
402  _("Accept Guild Invite"),
403  msg,
405  false,
406  Modal_false,
407  this);
409  mGuildInvited = guildId;
410 }
#define _(s)
Definition: gettext.h:34
ChatTab * localChatTab
Definition: chattab.cpp:61
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord=IgnoreRecord_false, const TryRemoveColors tryRemoveColors=TryRemoveColors_true)
Definition: chattab.cpp:109
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:251
static const std::string SOUND_REQUEST
Definition: sound.h:28
bool msg(InputEvent &event)
Definition: chat.cpp:38
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:24
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
ConfirmDialog * mGuildAcceptDialog
Definition: socialwindow.h:144

◆ showPartyInvite()

void SocialWindow::showPartyInvite ( const std::string &  partyName,
const std::string &  inviter,
const int  partyId 
)

Definition at line 412 of file socialwindow.cpp.

References _, Widget::addActionListener(), ChatMsgType::BY_SERVER, ChatTab::chatLog(), CREATEWIDGETV, localChatTab, Modal_false, mPartyAcceptDialog, mPartyId, mPartyInviter, Actions::msg(), SOUND_REQUEST, and strprintf().

Referenced by TmwAthena::PartyRecv::processPartyInvited(), and EAthena::PartyRecv::processPartyInvited().

415 {
416  // check there isnt already an invite showing
417  if (!mPartyInviter.empty())
418  {
419  if (localChatTab != nullptr)
420  {
421  // TRANSLATORS: chat message
422  localChatTab->chatLog(_("Received party request, but one already "
423  "exists."),
425  }
426  return;
427  }
428 
429  std::string msg;
430  if (inviter.empty())
431  {
432  if (partyName.empty())
433  {
434  // TRANSLATORS: party invite message
435  msg = _("You have been invited you to join a party.");
436  }
437  else
438  {
439  // TRANSLATORS: party invite message
440  msg = strprintf(_("You have been invited to join the %s party."),
441  partyName.c_str());
442  }
443  }
444  else
445  {
446  if (partyName.empty())
447  {
448  // TRANSLATORS: party invite message
449  msg = strprintf(_("%s has invited you to join their party."),
450  inviter.c_str());
451  }
452  else
453  {
454  // TRANSLATORS: party invite message
455  msg = strprintf(_("%s has invited you to join the %s party."),
456  inviter.c_str(), partyName.c_str());
457  }
458  }
459 
460  if (localChatTab != nullptr)
462 
463  // show invite
465  // TRANSLATORS: party invite message
466  _("Accept Party Invite"),
467  msg,
469  false,
470  Modal_false,
471  this);
473  mPartyInviter = inviter;
474  mPartyId = partyId;
475 }
#define _(s)
Definition: gettext.h:34
ChatTab * localChatTab
Definition: chattab.cpp:61
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord=IgnoreRecord_false, const TryRemoveColors tryRemoveColors=TryRemoveColors_true)
Definition: chattab.cpp:109
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:251
static const std::string SOUND_REQUEST
Definition: sound.h:28
bool msg(InputEvent &event)
Definition: chat.cpp:38
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:24
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
std::string mPartyInviter
Definition: socialwindow.h:146
ConfirmDialog * mPartyAcceptDialog
Definition: socialwindow.h:150

◆ slowLogic()

void SocialWindow::slowLogic ( )

Definition at line 482 of file socialwindow.cpp.

References BLOCK_END, BLOCK_START, cur_time, mFriends, mLastUpdateTime, mNeedUpdate, mPlayers, and SocialTab::updateList().

Referenced by Game::slowLogic().

483 {
484  BLOCK_START("SocialWindow::slowLogic")
485  const time_t nowTime = cur_time;
486  if (mNeedUpdate && nowTime - mLastUpdateTime > 1)
487  {
488  mPlayers->updateList();
489  mFriends->updateList();
490  mNeedUpdate = false;
491  mLastUpdateTime = nowTime;
492  }
493  else if (nowTime - mLastUpdateTime > 5)
494  {
495  mPlayers->updateList();
496  mNeedUpdate = false;
497  mLastUpdateTime = nowTime;
498  }
499  BLOCK_END("SocialWindow::slowLogic")
500 }
virtual void updateList()
Definition: socialtab.h:53
#define BLOCK_START(name)
Definition: perfomance.h:78
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:79
SocialTab * mFriends
Definition: socialwindow.h:156
volatile time_t cur_time
Definition: timer.cpp:57
time_t mLastUpdateTime
Definition: socialwindow.h:163
SocialTab * mPlayers
Definition: socialwindow.h:154

◆ updateActiveList()

void SocialWindow::updateActiveList ( )

◆ updateAll()

void SocialWindow::updateAll ( )
virtual

Implements PlayerRelationsListener.

Definition at line 647 of file socialwindow.cpp.

References BLOCK_END, BLOCK_START, BasicContainer::logicChildren(), and mNeedUpdate.

Referenced by setProcessedPortals().

648 {
649  mNeedUpdate = true;
650 }

◆ updateAttackFilter()

void SocialWindow::updateAttackFilter ( )

Definition at line 572 of file socialwindow.cpp.

References mAttackFilter, and SocialTab::updateList().

Referenced by Actions::changeRelation(), ActorManager::setPlayer(), and setProcessedPortals().

573 {
574  if (mAttackFilter != nullptr)
576 }
virtual void updateList()
Definition: socialtab.h:53
SocialTab * mAttackFilter
Definition: socialwindow.h:152

◆ updateAvatar()

void SocialWindow::updateAvatar ( const std::string &  name)

Definition at line 502 of file socialwindow.cpp.

References mPlayers, and SocialTab::updateAvatar().

Referenced by Being::takeDamage().

503 {
504  mPlayers->updateAvatar(name);
505 }
virtual void updateAvatar(const std::string &name)
Definition: socialtab.h:57
SocialTab * mPlayers
Definition: socialwindow.h:154

◆ updateButtons()

void SocialWindow::updateButtons ( )
protected

Definition at line 512 of file socialwindow.cpp.

Referenced by addTab(), postInit(), and removeTab().

513 {
514 // if (!mTabs)
515 // return;
516 
517 // const bool hasTabs = mTabs->getNumberOfTabs() > 0;
518 }

◆ updateCounter()

void SocialWindow::updateCounter ( const SocialTab *const  tab,
const std::string &  count 
)

Definition at line 608 of file socialwindow.cpp.

References Label::adjustSize(), TabbedArea::getSelectedTab(), mCountLabel, mTabs, and Label::setCaption().

Referenced by setProcessedPortals(), and SocialTab::updateCounter().

610 {
611  if (mTabs->getSelectedTab() == tab)
612  {
613  mCountLabel->setCaption(counter);
615  }
616 }
Label * mCountLabel
Definition: socialwindow.h:159
void setCaption(const std::string &caption)
Definition: label.cpp:256
TabbedArea * mTabs
Definition: socialwindow.h:160
Tab * getSelectedTab() const
Definition: tabbedarea.h:174
void adjustSize()
Definition: label.cpp:192

◆ updatedPlayer()

void SocialWindow::updatedPlayer ( const std::string &  name)
virtual

Implements PlayerRelationsListener.

Definition at line 642 of file socialwindow.cpp.

References mNeedUpdate.

Referenced by setProcessedPortals().

643 {
644  mNeedUpdate = true;
645 }

◆ updateGuildCounter()

void SocialWindow::updateGuildCounter ( const int  online = 0,
const int  total = 0 
)

Definition at line 625 of file socialwindow.cpp.

References SocialTab::buildCounter(), Being::getGuild(), guild, localPlayer, and mGuilds.

Referenced by GuildManager::process(), EAthena::GuildRecv::processGuildMemberList(), EAthena::GuildRecv::processGuildMemberLogin(), setProcessedPortals(), and GuildManager::updateList().

626 {
627  if (localPlayer == nullptr)
628  return;
629 
630  Guild *const guild = localPlayer->getGuild();
631  if (guild != nullptr)
632  {
633  const GuildMap::iterator it = mGuilds.find(guild);
634  if (it != mGuilds.end())
635  {
636  SocialTab *const tab = (*it).second;
637  tab->buildCounter(online, total);
638  }
639  }
640 }
const Guild * getGuild(const std::string &guildName) const
Definition: being.cpp:1219
GuildMap mGuilds
Definition: socialwindow.h:147
LocalPlayer * localPlayer
virtual void buildCounter(const int online, const int total)
Definition: socialtab.h:69
uint32_t guild
Definition: guild.h:68

◆ updateMenu()

void SocialWindow::updateMenu ( const SocialTab *const  tab,
const std::string &  menu 
)

Definition at line 618 of file socialwindow.cpp.

References TabbedArea::getSelectedTab(), mMenuButton, mTabs, and Widget::setActionEventId().

Referenced by setProcessedPortals(), and SocialTab::updateMenu().

620 {
621  if (mTabs->getSelectedTab() == tab)
623 }
void setActionEventId(const std::string &actionEventId)
Definition: widget.h:595
MenuTypeT menu
Definition: menu.cpp:27
Button * mMenuButton
Definition: socialwindow.h:158
TabbedArea * mTabs
Definition: socialwindow.h:160
Tab * getSelectedTab() const
Definition: tabbedarea.h:174

◆ updateParty()

void SocialWindow::updateParty ( )

Definition at line 584 of file socialwindow.cpp.

References SocialTab::buildCounter(), Being::getParty(), localPlayer, mParties, and party.

Referenced by TmwAthena::PartyRecv::processPartyInfo(), and EAthena::PartyRecv::processPartyInfo().

585 {
586  if (localPlayer == nullptr)
587  return;
588 
589  Party *const party = localPlayer->getParty();
590  if (party != nullptr)
591  {
592  const PartyMap::iterator it = mParties.find(party);
593  if (it != mParties.end())
594  {
595  SocialTab *const tab = (*it).second;
596  tab->buildCounter(0, 0);
597  }
598  }
599 }
PartyMap mParties
Definition: socialwindow.h:148
Definition: party.h:61
Party * getParty() const
Definition: being.h:325
uint32_t party
LocalPlayer * localPlayer
virtual void buildCounter(const int online, const int total)
Definition: socialtab.h:69

◆ updatePickupFilter()

void SocialWindow::updatePickupFilter ( )

Definition at line 578 of file socialwindow.cpp.

References mPickupFilter, and SocialTab::updateList().

Referenced by Actions::changeRelation(), ActorManager::setPlayer(), and setProcessedPortals().

579 {
580  if (mPickupFilter != nullptr)
582 }
virtual void updateList()
Definition: socialtab.h:53
SocialTab * mPickupFilter
Definition: socialwindow.h:153

◆ updatePortalNames()

void SocialWindow::updatePortalNames ( )

Definition at line 526 of file socialwindow.cpp.

References mNavigation.

Referenced by RenameListener::action().

527 {
528  if (mNavigation != nullptr)
529  static_cast<SocialNavigationTab*>(mNavigation)->updateNames();
530 }
SocialTab * mNavigation
Definition: socialwindow.h:155

◆ updatePortals()

void SocialWindow::updatePortals ( )

Definition at line 520 of file socialwindow.cpp.

References mNavigation, and SocialTab::updateList().

Referenced by LocalPlayer::updateCoords().

521 {
522  if (mNavigation != nullptr)
524 }
virtual void updateList()
Definition: socialtab.h:53
SocialTab * mNavigation
Definition: socialwindow.h:155

◆ widgetResized()

void SocialWindow::widgetResized ( const Event event)
virtual

Called whenever the widget changes size.

Reimplemented from Window.

Definition at line 601 of file socialwindow.cpp.

References TabbedArea::adjustSize(), mTabs, and Window::widgetResized().

Referenced by postInit(), and setProcessedPortals().

602 {
603  Window::widgetResized(event);
604  if (mTabs != nullptr)
605  mTabs->adjustSize();
606 }
void widgetResized(const Event &event)
Definition: window.cpp:643
void adjustSize()
Definition: tabbedarea.cpp:559
TabbedArea * mTabs
Definition: socialwindow.h:160

Friends And Related Function Documentation

◆ SocialTab

friend class SocialTab
friend

Definition at line 137 of file socialwindow.h.

Field Documentation

◆ mAttackFilter

SocialTab* SocialWindow::mAttackFilter
protected

Definition at line 152 of file socialwindow.h.

Referenced by postInit(), updateAttackFilter(), and ~SocialWindow().

◆ mCountLabel

Label* SocialWindow::mCountLabel
protected

Definition at line 159 of file socialwindow.h.

Referenced by postInit(), and updateCounter().

◆ mFriends

SocialTab* SocialWindow::mFriends
protected

Definition at line 156 of file socialwindow.h.

Referenced by postInit(), slowLogic(), and ~SocialWindow().

◆ mGuildAcceptDialog

ConfirmDialog* SocialWindow::mGuildAcceptDialog
protected

Definition at line 144 of file socialwindow.h.

Referenced by action(), showGuildInvite(), and ~SocialWindow().

◆ mGuildCreateDialog

TextDialog* SocialWindow::mGuildCreateDialog
protected

Definition at line 145 of file socialwindow.h.

◆ mGuildInvited

int SocialWindow::mGuildInvited
protected

Definition at line 143 of file socialwindow.h.

Referenced by action(), showGuildInvite(), and ~SocialWindow().

◆ mGuilds

GuildMap SocialWindow::mGuilds
protected

Definition at line 147 of file socialwindow.h.

Referenced by addTab(), removeTab(), updateGuildCounter(), and ~SocialWindow().

◆ mLastUpdateTime

time_t SocialWindow::mLastUpdateTime
protected

Definition at line 163 of file socialwindow.h.

Referenced by slowLogic().

◆ mMap

Map* SocialWindow::mMap
protected

Definition at line 161 of file socialwindow.h.

Referenced by getMap(), and setMap().

◆ mMenuButton

Button* SocialWindow::mMenuButton
protected

Definition at line 158 of file socialwindow.h.

Referenced by postInit(), and updateMenu().

◆ mNavigation

SocialTab* SocialWindow::mNavigation
protected

◆ mNeedUpdate

bool SocialWindow::mNeedUpdate
protected

Definition at line 165 of file socialwindow.h.

Referenced by slowLogic(), updateActiveList(), updateAll(), and updatedPlayer().

◆ mParties

PartyMap SocialWindow::mParties
protected

Definition at line 148 of file socialwindow.h.

Referenced by addTab(), removeTab(), updateParty(), and ~SocialWindow().

◆ mPartyAcceptDialog

ConfirmDialog* SocialWindow::mPartyAcceptDialog
protected

Definition at line 150 of file socialwindow.h.

Referenced by action(), showPartyInvite(), and ~SocialWindow().

◆ mPartyId

int SocialWindow::mPartyId
protected

Definition at line 164 of file socialwindow.h.

Referenced by action(), and showPartyInvite().

◆ mPartyInviter

std::string SocialWindow::mPartyInviter
protected

Definition at line 146 of file socialwindow.h.

Referenced by action(), showPartyInvite(), and ~SocialWindow().

◆ mPickupFilter

SocialTab* SocialWindow::mPickupFilter
protected

Definition at line 153 of file socialwindow.h.

Referenced by postInit(), updatePickupFilter(), and ~SocialWindow().

◆ mPlayers

SocialTab* SocialWindow::mPlayers
protected

Definition at line 154 of file socialwindow.h.

Referenced by postInit(), resetDamage(), slowLogic(), updateAvatar(), and ~SocialWindow().

◆ mProcessedPortals

bool SocialWindow::mProcessedPortals
protected

Definition at line 166 of file socialwindow.h.

Referenced by getProcessedPortals(), setMap(), and setProcessedPortals().

◆ mTabs

TabbedArea* SocialWindow::mTabs
protected

The documentation for this class was generated from the following files: