ManaPlus
Public Member Functions | Private Member Functions | Private Attributes

#include <ministatuswindow.h>

Inheritance diagram for MiniStatusWindow:
Window InventoryListener AttributeListener StatListener ArrowsListener UpdateStatusListener BasicContainer2 MouseListener WidgetListener BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 MiniStatusWindow ()
 
 ~MiniStatusWindow ()
 
void setIcon (const int index, AnimatedSprite *const sprite)
 
void eraseIcon (const int index)
 
void drawIcons (Graphics *const graphics)
 
void updateStatus ()
 
void logic ()
 
void draw (Graphics *const graphics)
 
void safeDraw (Graphics *const graphics)
 
void mouseMoved (MouseEvent &event)
 
void mousePressed (MouseEvent &event)
 
void mouseExited (MouseEvent &event)
 
void showBar (const std::string &name, const Visible visible)
 
void updateBars ()
 
void slotsChanged (const Inventory *const inventory)
 
std::vector< ProgressBar * > & getBars ()
 
Rect getChildrenArea ()
 
void attributeChanged (const AttributesT id, const int64_t oldVal, const int64_t newVal)
 
void statChanged (const AttributesT id, const int oldVal1, const int oldVal2)
 
void arrowsChanged ()
 
- Public Member Functions inherited from Window
 Window (const std::string &caption, const Modal modal, Window *const parent, std::string skin)
 
 ~Window ()
 
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, int offsetY)
 
void setResizable (const bool resize)
 
void redraw ()
 
void widgetResized (const Event &event)
 
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)
 
void postInit ()
 
WindowgetParentWindow () const
 
virtual void scheduleDelete ()
 
void mouseDragged (MouseEvent &event)
 
void mouseReleased (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, const int offsetY)
 
virtual void resetToDefaultSize ()
 
void adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight)
 
LayoutgetLayout ()
 
void clearLayout ()
 
void reflowLayout (int w, int h)
 
LayoutCellplace (const int x, const int y, Widget *const wg, const int w, const int h)
 
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
 
virtual void resizeToContent ()
 
- Public Member Functions inherited from BasicContainer2
 BasicContainer2 (const Widget2 *const widget)
 
 ~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)
 
 ~BasicContainer ()
 
void showWidgetPart (Widget *const widget, const Rect &area)
 
void moveToTop (Widget *const widget)
 
void moveToBottom (Widget *const widget)
 
void focusNext ()
 
void focusPrevious ()
 
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)
 
 ~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) 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 InventoryListener
virtual ~InventoryListener ()
 
- Public Member Functions inherited from AttributeListener
 AttributeListener ()
 
virtual ~ AttributeListener ()
 
- Public Member Functions inherited from StatListener
 StatListener ()
 
virtual ~ StatListener ()
 
- Public Member Functions inherited from ArrowsListener
 ArrowsListener ()
 
virtual ~ ArrowsListener ()
 
- Public Member Functions inherited from UpdateStatusListener
 UpdateStatusListener ()
 
virtual ~ UpdateStatusListener ()
 

Private Member Functions

bool isInBar (ProgressBar *bar, int x, int y) const
 
ProgressBarcreateBar (const float progress, const int width, const int height, const ThemeColorIdT textColor, const ProgressColorIdT backColor, const std::string &skin, const std::string &skinFill, const std::string &name, const std::string &description)
 
void loadBars ()
 
void saveBars () const
 

Private Attributes

std::vector< ProgressBar * > mBars
 
std::map< std::string, ProgressBar * > mBarNames
 
std::vector< AnimatedSprite * > mIcons
 
ProgressBarmHpBar
 
ProgressBarmMpBar
 
ProgressBarmXpBar
 
ProgressBarmJobBar
 
ProgressBarmWeightBar
 
ProgressBarmInvSlotsBar
 
ProgressBarmMoneyBar
 
ProgressBarmArrowsBar
 
ProgressBarmStatusBar
 
StatusPopupmStatusPopup
 
int mSpacing
 
int mIconPadding
 
int mIconSpacing
 
int mMaxX
 

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)
 
- Static Public Member Functions inherited from AttributeListener
static void distributeEvent (const AttributesT id, const int64_t oldVal, const int64_t newVal)
 
static void addListener (AttributeListener *const listener)
 
static void removeListener (const AttributeListener *const listener)
 
- Static Public Member Functions inherited from StatListener
static void distributeEvent (const AttributesT id, const int oldVal1, const int oldVal2)
 
static void addListener (StatListener *const listener)
 
static void removeListener (const StatListener *const listener)
 
- Static Public Member Functions inherited from ArrowsListener
static void distributeEvent ()
 
static void addListener (ArrowsListener *const listener)
 
static void removeListener (const ArrowsListener *const listener)
 
- Static Public Member Functions inherited from UpdateStatusListener
static void distributeEvent ()
 
static void addListener (UpdateStatusListener *const listener)
 
static void removeListener (const UpdateStatusListener *const listener)
 
- Data Fields inherited from Widget
Visible mVisible
 
- 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 inherited from Window
bool canMove () const
 
int getOption (const std::string &name, const int def) const
 
bool getOptionBool (const std::string &name, const bool def) 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 InventoryListener
 InventoryListener ()
 
- 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
 
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0
 

Detailed Description

The player mini-status dialog.

Definition at line 45 of file ministatuswindow.h.

Constructor & Destructor Documentation

◆ MiniStatusWindow()

MiniStatusWindow::MiniStatusWindow ( )

Definition at line 60 of file ministatuswindow.cpp.

References _, Inventory::addInventoyListener(), Widget::addMouseListener(), createBar(), PlayerInfo::getInventory(), ConfigurationObject::getValueBool(), ThemeColorId::JOB_BAR, loadBars(), mArrowsBar, mHpBar, mJobBar, mMoneyBar, mMpBar, mXpBar, ProgressColorId::PROG_JOB, serverConfig, Window::setVisible(), statusWindow, StatusWindow::updateArrowsBar(), updateBars(), StatusWindow::updateHPBar(), StatusWindow::updateJobBar(), StatusWindow::updateMoneyBar(), StatusWindow::updateMPBar(), updateStatus(), StatusWindow::updateXPBar(), and Visible_true.

60  :
61  Window("MiniStatus", Modal_false, nullptr, "ministatus.xml"),
64  StatListener(),
67  mBars(),
68  mBarNames(),
69  mIcons(),
71  "hpprogressbar.xml", "hpprogressbar_fill.xml",
72  // TRANSLATORS: status bar name
73  "hp bar", _("health bar"))),
79  ? "mpprogressbar.xml" : "nompprogressbar.xml",
81  ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml",
82  // TRANSLATORS: status bar name
83  "mp bar", _("mana bar"))),
84  mXpBar(createBar(0, 100, 0,
86  "xpprogressbar.xml", "xpprogressbar_fill.xml",
87  // TRANSLATORS: status bar name
88  "xp bar", _("experience bar"))),
89  mJobBar(nullptr),
92  "weightprogressbar.xml", "weightprogressbar_fill.xml",
93  // TRANSLATORS: status bar name
94  "weight bar", _("weight bar"))),
95  mInvSlotsBar(createBar(0, 45, 0,
97  "slotsprogressbar.xml", "slotsprogressbar_fill.xml",
98  "inventory slots bar",
99  // TRANSLATORS: status bar name
100  _("inventory slots bar"))),
103  "moneyprogressbar.xml", "moneyprogressbar_fill.xml",
104  // TRANSLATORS: status bar name
105  "money bar", _("money bar"))),
108  "arrowsprogressbar.xml", "arrowsprogressbar_fill.xml",
109  // TRANSLATORS: status bar name
110  "arrows bar", _("arrows bar"))),
111  mStatusBar(createBar(100, (config.getIntValue("fontSize") > 16
112  ? 270 : 180), 0, ThemeColorId::STATUS_BAR,
114  "statusprogressbar.xml", "statusprogressbar_fill.xml",
115  // TRANSLATORS: status bar name
116  "status bar", _("status bar"))),
118  mSpacing(mSkin != nullptr ? mSkin->getOption("spacing", 3) : 3),
119  mIconPadding(mSkin != nullptr ? mSkin->getOption("iconPadding", 3) : 3),
120  mIconSpacing(mSkin != nullptr ? mSkin->getOption("iconSpacing", 2) : 2),
121  mMaxX(0)
122 {
124  false);
125 
126  if (statusWindow != nullptr)
127  {
129  false);
130  }
131 
132  const bool job = serverConfig.getValueBool("showJob", true);
133 
135  true);
136 
137  if (job)
138  {
139  mJobBar = createBar(0, 100, 0,
142  "jobprogressbar.xml", "jobprogressbar_fill.xml",
143  // TRANSLATORS: status bar name
144  "job bar", _("job bar"));
146  true);
147  }
148 
149  loadBars();
150  updateBars();
151 
153  addMouseListener(this);
154  Inventory *const inv = PlayerInfo::getInventory();
155  if (inv != nullptr)
156  inv->addInventoyListener(this);
157 
160  updateStatus();
161 }
Net::PlayerHandler * playerHandler
Definition: net.cpp:93
#define _(s)
Definition: gettext.h:34
Skin * mSkin
Definition: window.h:648
std::map< std::string, ProgressBar * > mBarNames
ProgressBar * mMoneyBar
const bool Visible_true
Definition: visible.h:29
ProgressBar * mStatusBar
virtual bool canUseMagic() const =0
Inventory * getInventory()
Definition: playerinfo.cpp:193
Configuration config
static void updateArrowsBar(ProgressBar *const bar)
StatusWindow * statusWindow
int getIntValue(const std::string &key) const
Configuration serverConfig
int getOption(const std::string &name) const
Definition: skin.h:105
ProgressBar * mWeightBar
void updateMPBar(ProgressBar *bar, const bool showMax) const
static void updateHPBar(ProgressBar *const bar, const bool showMax)
static void updateMoneyBar(ProgressBar *const bar)
bool getValueBool(const std::string &key, const bool deflt) const
StatusPopup * mStatusPopup
void addMouseListener(MouseListener *const mouseListener)
Definition: widget.cpp:291
ProgressBar * mArrowsBar
ProgressBar * mInvSlotsBar
virtual void setVisible(Visible visible)
Definition: window.cpp:777
ProgressBar * mHpBar
ProgressBar * createBar(const float progress, const int width, const int height, const ThemeColorIdT textColor, const ProgressColorIdT backColor, const std::string &skin, const std::string &skinFill, const std::string &name, const std::string &description)
ProgressBar * mXpBar
std::vector< AnimatedSprite * > mIcons
void addInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:301
std::vector< ProgressBar * > mBars
static void updateXPBar(ProgressBar *const bar, const bool percent)
static void updateJobBar(ProgressBar *const bar, const bool percent)
ProgressBar * mJobBar
ProgressBar * mMpBar
Window(const std::string &caption, const Modal modal, Window *const parent, std::string skin)
Definition: window.cpp:108
#define CREATEWIDGETR0(type)
Definition: createwidget.h:38

◆ ~MiniStatusWindow()

MiniStatusWindow::~MiniStatusWindow ( )

Definition at line 163 of file ministatuswindow.cpp.

References delete2, delete_all(), FOR_EACH, PlayerInfo::getInventory(), mBars, mIcons, mStatusPopup, Widget::mVisible, Inventory::removeInventoyListener(), and Visible_false.

164 {
167  mIcons.clear();
168 
169  Inventory *const inv = PlayerInfo::getInventory();
170  if (inv != nullptr)
171  inv->removeInventoyListener(this);
172 
174  {
175  ProgressBar *bar = *it;
176  if (bar == nullptr)
177  continue;
178  if (bar->mVisible == Visible_false)
179  delete bar;
180  }
181  mBars.clear();
182 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
Inventory * getInventory()
Definition: playerinfo.cpp:193
#define delete2(var)
Definition: delete2.h:24
Visible mVisible
Definition: widget.h:962
void delete_all(Container &c)
Definition: dtor.h:55
const bool Visible_false
Definition: visible.h:29
StatusPopup * mStatusPopup
std::vector< AnimatedSprite * > mIcons
std::vector< ProgressBar * > mBars
std::vector< ProgressBar * >::const_iterator ProgressBarVectorCIter
void removeInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:306

Member Function Documentation

◆ arrowsChanged()

void MiniStatusWindow::arrowsChanged ( )
virtual

Implements ArrowsListener.

Definition at line 599 of file ministatuswindow.cpp.

References BLOCK_END, BLOCK_START, BasicContainer::logicChildren(), mArrowsBar, and StatusWindow::updateArrowsBar().

Referenced by getBars().

600 {
602 }
static void updateArrowsBar(ProgressBar *const bar)
ProgressBar * mArrowsBar

◆ attributeChanged()

void MiniStatusWindow::attributeChanged ( const AttributesT  id,
const int64_t  oldVal,
const int64_t  newVal 
)
virtual

Implements AttributeListener.

Definition at line 281 of file ministatuswindow.cpp.

References Attributes::MAX_WEIGHT, mHpBar, mMoneyBar, mMpBar, Attributes::MONEY, mWeightBar, mXpBar, Attributes::PLAYER_EXP, Attributes::PLAYER_EXP_NEEDED, Attributes::PLAYER_HP, Attributes::PLAYER_MAX_HP, Attributes::PLAYER_MAX_MP, Attributes::PLAYER_MP, PRAGMA45(), statusWindow, Attributes::TOTAL_WEIGHT, StatusWindow::updateHPBar(), StatusWindow::updateMoneyBar(), StatusWindow::updateMPBar(), StatusWindow::updateWeightBar(), and StatusWindow::updateXPBar().

Referenced by getBars().

284 {
285  PRAGMA45(GCC diagnostic push)
286  PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
287  switch (id)
288  {
292  false);
293  break;
297  false);
298  break;
302  true);
303  break;
307  break;
308  case Attributes::MONEY:
310  break;
311  default:
312  break;
313  }
314  PRAGMA45(GCC diagnostic pop)
315 }
ProgressBar * mMoneyBar
static void updateWeightBar(ProgressBar *const bar)
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wunused-result") int TestLauncher
StatusWindow * statusWindow
ProgressBar * mWeightBar
void updateMPBar(ProgressBar *bar, const bool showMax) const
static void updateHPBar(ProgressBar *const bar, const bool showMax)
static void updateMoneyBar(ProgressBar *const bar)
ProgressBar * mHpBar
ProgressBar * mXpBar
static void updateXPBar(ProgressBar *const bar, const bool percent)
ProgressBar * mMpBar

◆ createBar()

ProgressBar * MiniStatusWindow::createBar ( const float  progress,
const int  width,
const int  height,
const ThemeColorIdT  textColor,
const ProgressColorIdT  backColor,
const std::string &  skin,
const std::string &  skinFill,
const std::string &  name,
const std::string &  description 
)
private

Definition at line 184 of file ministatuswindow.cpp.

References Widget2::getThemeColor(), mBarNames, mBars, Widget::setActionEventId(), ProgressBar::setColor(), and Widget::setId().

Referenced by getBars(), and MiniStatusWindow().

194 {
195  ProgressBar *const bar = new ProgressBar(this,
196  progress, width, height, backColor, skin, skinFill);
197  bar->setActionEventId(name);
198  bar->setId(description);
199  bar->setColor(getThemeColor(textColor, 255U),
200  getThemeColor(textColor + 1, 255U));
201  mBars.push_back(bar);
202  mBarNames[name] = bar;
203  return bar;
204 }
std::map< std::string, ProgressBar * > mBarNames
void setActionEventId(const std::string &actionEventId)
Definition: widget.h:595
void setId(const std::string &id)
Definition: widget.h:915
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
Definition: widget2.h:44
std::vector< ProgressBar * > mBars
void setColor(const Color &color1, const Color &color2)

◆ draw()

void MiniStatusWindow::draw ( Graphics *const  graphics)
virtual

Draws the window.

Reimplemented from Window.

Definition at line 342 of file ministatuswindow.cpp.

References BLOCK_END, BLOCK_START, and BasicContainer::drawChildren().

343 {
344  BLOCK_START("MiniStatusWindow::draw")
345  drawChildren(graphics);
347 }
#define BLOCK_START(name)
Definition: perfomance.h:78
#define BLOCK_END(name)
Definition: perfomance.h:79
void draw(Graphics *const graphics)
virtual void drawChildren(Graphics *const graphics)

◆ drawIcons()

void MiniStatusWindow::drawIcons ( Graphics *const  graphics)

Definition at line 253 of file ministatuswindow.cpp.

References CAST_S32, CAST_U32, AnimatedSprite::draw(), AnimatedSprite::getWidth(), mIconPadding, mIcons, mIconSpacing, and mMaxX.

254 {
255  // Draw icons
256  unsigned int icon_x = mMaxX + mIconPadding;
257  for (size_t i = 0, sz = mIcons.size(); i < sz; i ++)
258  {
259  const AnimatedSprite *const icon = mIcons[i];
260  if (icon != nullptr)
261  {
262  icon->draw(graphics, CAST_S32(icon_x), mIconPadding);
263  icon_x += CAST_U32(mIconSpacing + icon->getWidth());
264  }
265  }
266 }
#define CAST_U32
Definition: cast.h:30
void draw(Graphics *const graphics, const int posX, const int posY) const
#define CAST_S32
Definition: cast.h:29
int getWidth() const
std::vector< AnimatedSprite * > mIcons

◆ eraseIcon()

void MiniStatusWindow::eraseIcon ( const int  index)

Definition at line 244 of file ministatuswindow.cpp.

References CAST_S32, and mIcons.

Referenced by LocalPlayer::handleStatusEffect().

245 {
246  if (index < CAST_S32(mIcons.size()))
247  {
248  delete mIcons[index];
249  mIcons.erase(mIcons.begin() + index);
250  }
251 }
#define CAST_S32
Definition: cast.h:29
std::vector< AnimatedSprite * > mIcons

◆ getBars()

std::vector<ProgressBar*>& MiniStatusWindow::getBars ( )
inline

◆ getChildrenArea()

Rect MiniStatusWindow::getChildrenArea ( )
virtual

Gets the area of the widget occupied by the widget's children. By default this method returns an empty rectangle as not all widgets are containers. If you want to make a container this method should return the area where the children resides. This method is used when drawing children of a widget when computing clip rectangles for the children.

An example of a widget that overloads this method is ScrollArea. A ScrollArea has a view of its contant and that view is the children area. The size of a ScrollArea's children area might vary depending on if the scroll bars of the ScrollArea is shown or not.

Returns
The area of the widget occupied by the widget's children.
See also
BasicContainer
BasicContainer::getChildrenArea
BasicContainer::drawChildren

Reimplemented from Window.

Definition at line 589 of file ministatuswindow.cpp.

References Rect::height, Widget::mDimension, Window::mPadding, and Rect::width.

Referenced by getBars().

590 {
591  const int padding = mPadding;
592  const int padding2 = padding * 2;
593  const Rect &rect = mDimension;
594  return Rect(padding, padding,
595  rect.width - padding2,
596  rect.height - padding2);
597 }
int width
Definition: rect.h:218
int mPadding
Definition: window.h:617
Definition: rect.h:72
int height
Definition: rect.h:223
Rect mDimension
Definition: widget.h:1100

◆ isInBar()

bool MiniStatusWindow::isInBar ( ProgressBar bar,
int  x,
int  y 
) const
private

Referenced by getBars().

◆ loadBars()

void MiniStatusWindow::loadBars ( )
private

Definition at line 529 of file ministatuswindow.cpp.

References config, Configuration::getIntValue(), ConfigurationObject::getValue(), mArrowsBar, mBarNames, mInvSlotsBar, mJobBar, mMoneyBar, mStatusBar, mWeightBar, Widget::setVisible(), ServerCommandType::str, Catch::toString(), Visible_false, and Visible_true.

Referenced by getBars(), and MiniStatusWindow().

530 {
531  if (config.getIntValue("ministatussaved") == 0)
532  {
533  if (mWeightBar != nullptr)
535  if (mInvSlotsBar != nullptr)
537  if (mMoneyBar != nullptr)
539  if (mArrowsBar != nullptr)
541  if (mStatusBar != nullptr)
543  if (mJobBar != nullptr)
545  return;
546  }
547 
548  for (int f = 0; f < 10; f ++)
549  {
550  const std::string str = config.getValue(
551  "ministatus" + toString(f), "");
552  if (str.empty())
553  continue;
554  ProgressBar *const bar = mBarNames[str];
555  if (bar == nullptr)
556  continue;
558  }
559 }
std::map< std::string, ProgressBar * > mBarNames
ProgressBar * mMoneyBar
const bool Visible_true
Definition: visible.h:29
void setVisible(Visible visible)
Definition: widget.cpp:224
ProgressBar * mStatusBar
Configuration config
int getIntValue(const std::string &key) const
ProgressBar * mWeightBar
const bool Visible_false
Definition: visible.h:29
ProgressBar * mArrowsBar
ProgressBar * mInvSlotsBar
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
std::string getValue(const std::string &key, const std::string &deflt) const
ProgressBar * mJobBar

◆ logic()

void MiniStatusWindow::logic ( )
virtual

Called for all widgets in the gui each time Gui::logic is called. You can do logic stuff here like playing an animation.

See also
Gui::logic

Reimplemented from BasicContainer.

Definition at line 328 of file ministatuswindow.cpp.

References BLOCK_END, BLOCK_START, BasicContainer::logic(), mIcons, tick_time, and AnimatedSprite::update().

329 {
330  BLOCK_START("MiniStatusWindow::logic")
331  Window::logic();
332 
333  for (size_t i = 0, sz = mIcons.size(); i < sz; i++)
334  {
335  AnimatedSprite *const icon = mIcons[i];
336  if (icon != nullptr)
337  icon->update(tick_time * 10);
338  }
339  BLOCK_END("MiniStatusWindow::logic")
340 }
volatile int tick_time
Definition: timer.cpp:52
Definition: window.h:98
#define BLOCK_START(name)
Definition: perfomance.h:78
#define BLOCK_END(name)
Definition: perfomance.h:79
std::vector< AnimatedSprite * > mIcons
bool update(const int time)

◆ mouseExited()

void MiniStatusWindow::mouseExited ( MouseEvent event)
virtual

When the mouse leaves the window this ensures that the custom cursor is restored back to it's standard image.

Reimplemented from Window.

Definition at line 510 of file ministatuswindow.cpp.

References Popup::hide(), Window::mouseExited(), mStatusPopup, and textPopup.

511 {
512  Window::mouseExited(event);
513 
514  textPopup->hide();
515  mStatusPopup->hide();
516 }
void hide()
Definition: popup.cpp:264
StatusPopup * mStatusPopup
void mouseExited(MouseEvent &event)
Definition: window.cpp:923
TextPopup * textPopup
Definition: textpopup.cpp:32

◆ mouseMoved()

void MiniStatusWindow::mouseMoved ( MouseEvent event)
virtual

Implements custom cursor image changing context, based on mouse relative position.

Reimplemented from Window.

Definition at line 356 of file ministatuswindow.cpp.

References _, CAST_U64, ServerCommandType::exp, PlayerInfo::getAttribute(), PlayerInfo::getAttribute64(), Being::getGroupId(), Widget::getId(), PlayerInfo::getInventory(), Inventory::getNumberOfSlotsUsed(), Inventory::getSize(), Event::getSource(), Popup::hide(), Being::isGM(), localPlayer, Attributes::MAX_WEIGHT, Widget::mDimension, mHpBar, mInvSlotsBar, mJobBar, mMoneyBar, mMpBar, Attributes::MONEY, Window::mouseMoved(), mStatusBar, mStatusPopup, mWeightBar, mXpBar, Attributes::PLAYER_BASE_LEVEL, Attributes::PLAYER_EXP, Attributes::PLAYER_EXP_NEEDED, Attributes::PLAYER_HP, Attributes::PLAYER_JOB_EXP, Attributes::PLAYER_JOB_EXP_NEEDED, Attributes::PLAYER_JOB_LEVEL, Attributes::PLAYER_MAX_HP, Attributes::PLAYER_MAX_MP, Attributes::PLAYER_MP, TextPopup::show(), ServerCommandType::str, strprintf(), textPopup, Catch::toString(), Attributes::TOTAL_WEIGHT, StatusPopup::view(), x, Rect::x, y, and Rect::y.

357 {
358  Window::mouseMoved(event);
359 
360  const int x = event.getX();
361  const int y = event.getY();
362 
363  const Rect &rect = mDimension;
364  if (event.getSource() == mStatusBar)
365  {
366  mStatusPopup->view(x + rect.x, y + rect.y);
367  textPopup->hide();
368  }
369  else if (event.getSource() == mXpBar)
370  {
371  std::string level;
372  if ((localPlayer != nullptr) && localPlayer->isGM())
373  {
374  // TRANSLATORS: status bar label
375  level = strprintf(_("Level: %d (GM %d)"),
378  }
379  else
380  {
381  // TRANSLATORS: status bar label
382  level = strprintf(_("Level: %d"),
384  }
385 
387  const int64_t expNeed = PlayerInfo::getAttribute64(
389  const std::string str = toString(CAST_U64(exp)) +
390  "/" +
391  toString(CAST_U64(expNeed));
392  if (exp > expNeed)
393  {
394  textPopup->show(x + rect.x,
395  y + rect.y,
396  level,
397  str);
398  }
399  else
400  {
401  const std::string str2 = toString(CAST_U64(expNeed - exp));
402  textPopup->show(x + rect.x,
403  y + rect.y,
404  level,
405  str,
406  // TRANSLATORS: status bar label
407  strprintf("%s: %s", _("Need"), str2.c_str()));
408  }
409  mStatusPopup->hide();
410  }
411  else if (event.getSource() == mHpBar)
412  {
413  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
416  mStatusPopup->hide();
417  }
418  else if (event.getSource() == mMpBar)
419  {
420  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
423  mStatusPopup->hide();
424  }
425  else if (event.getSource() == mJobBar)
426  {
427  const int64_t exp = PlayerInfo::getAttribute64(
429  const int64_t expNeed = PlayerInfo::getAttribute64(
431  const int32_t jobLevel = PlayerInfo::getAttribute(
433  const std::string expStr = toString(CAST_U64(exp));
434  const std::string expNeedStr = toString(CAST_U64(expNeed));
435  const std::string expLeftStr = toString(CAST_U64(expNeed - exp));
436 
437  // TRANSLATORS: job bar label
438  const std::string level = strprintf(_("Job level: %d"),
439  jobLevel);
440 
441  if (exp > expNeed)
442  {
443  textPopup->show(x + rect.x,
444  y + rect.y,
445  level,
446  strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str()));
447  }
448  else
449  {
450  textPopup->show(x + rect.x,
451  y + rect.y,
452  level,
453  strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str()),
454  // TRANSLATORS: status bar label
455  strprintf("%s: %s", _("Need"), expLeftStr.c_str()));
456  }
457  mStatusPopup->hide();
458  }
459  else if (event.getSource() == mWeightBar)
460  {
461  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
465  mStatusPopup->hide();
466  }
467  else if (event.getSource() == mInvSlotsBar)
468  {
469  const Inventory *const inv = PlayerInfo::getInventory();
470  if (inv != nullptr)
471  {
472  const int usedSlots = inv->getNumberOfSlotsUsed();
473  const int maxSlots = inv->getSize();
474  textPopup->show(x + rect.x, y + rect.y,
475  event.getSource()->getId(),
476  strprintf("%d/%d", usedSlots, maxSlots));
477  }
478  mStatusPopup->hide();
479  }
480  else if (event.getSource() == mMoneyBar)
481  {
482  textPopup->show(x + rect.x, y + rect.y,
483  event.getSource()->getId(),
485  }
486  else
487  {
488  textPopup->hide();
489  mStatusPopup->hide();
490  }
491 }
void show(const int x, const int y, const std::string &str1)
Definition: textpopup.h:56
#define _(s)
Definition: gettext.h:34
int getNumberOfSlotsUsed() const
Definition: inventory.h:163
ProgressBar * mMoneyBar
ProgressBar * mStatusBar
Definition: rect.h:72
#define CAST_U64
Definition: cast.h:32
Inventory * getInventory()
Definition: playerinfo.cpp:193
void mouseMoved(MouseEvent &event)
Definition: window.cpp:966
void view(const int x, const int y)
ProgressBar * mWeightBar
int64_t getAttribute64(const AttributesT id)
Definition: playerinfo.cpp:92
int x
Definition: rect.h:208
void hide()
Definition: popup.cpp:264
const std::string & getId() const
Definition: widget.h:918
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Widget * getSource() const
Definition: event.h:103
int y
Definition: rect.h:213
LocalPlayer * localPlayer
StatusPopup * mStatusPopup
int getGroupId() const
Definition: being.h:1090
ProgressBar * mInvSlotsBar
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
ProgressBar * mHpBar
ProgressBar * mXpBar
ProgressBar * mJobBar
ProgressBar * mMpBar
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:100
Rect mDimension
Definition: widget.h:1100
bool isGM() const
Definition: being.h:658
TextPopup * textPopup
Definition: textpopup.cpp:32
unsigned getSize() const
Definition: inventory.h:75

◆ mousePressed()

void MiniStatusWindow::mousePressed ( MouseEvent event)
virtual

Starts window resizing when appropriate.

Reimplemented from Window.

Definition at line 493 of file ministatuswindow.cpp.

References MouseEvent::getButton(), MouseEvent::getX(), Widget::getX(), Widget::getY(), popupManager, popupMenu, MouseButton::RIGHT, and PopupMenu::showPopup().

494 {
495  if (event.getButton() == MouseButton::RIGHT)
496  {
497  const ProgressBar *const bar = dynamic_cast<ProgressBar*>(
498  event.getSource());
499  if (bar == nullptr)
500  return;
501  event.consume();
502  if (popupManager != nullptr)
503  {
504  popupMenu->showPopup(getX() + event.getX(),
505  getY() + event.getY(), bar);
506  }
507  }
508 }
int getY() const
Definition: widget.h:287
MouseButtonT getButton() const
Definition: mouseevent.h:115
PopupManager * popupManager
PopupMenu * popupMenu
Definition: popupmenu.cpp:102
int getX() const
Definition: widget.h:268
int getX() const
Definition: mouseevent.h:126
void showPopup(const int x, const int y, const Being *const being)
Definition: popupmenu.cpp:202

◆ safeDraw()

void MiniStatusWindow::safeDraw ( Graphics *const  graphics)
virtual

Reimplemented from Window.

Definition at line 349 of file ministatuswindow.cpp.

References BLOCK_END, BLOCK_START, and BasicContainer::safeDrawChildren().

350 {
351  BLOCK_START("MiniStatusWindow::draw")
352  safeDrawChildren(graphics);
354 }
#define BLOCK_START(name)
Definition: perfomance.h:78
#define BLOCK_END(name)
Definition: perfomance.h:79
void draw(Graphics *const graphics)
virtual void safeDrawChildren(Graphics *const graphics)

◆ saveBars()

void MiniStatusWindow::saveBars ( ) const
private

Definition at line 561 of file ministatuswindow.cpp.

References config, ConfigurationObject::deleteKey(), FOR_EACH, Widget::getActionEventId(), mBars, Widget::mVisible, Configuration::setValue(), Catch::toString(), and Visible_false.

Referenced by getBars(), and showBar().

562 {
563  int i = 0;
565  {
566  const ProgressBar *const bar = *it;
567  if (bar->mVisible == Visible_false)
568  {
569  config.setValue("ministatus" + toString(i),
570  bar->getActionEventId());
571  i ++;
572  }
573  }
574  for (int f = i; f < 10; f ++)
575  config.deleteKey("ministatus" + toString(f));
576 
577  config.setValue("ministatussaved", true);
578 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
Configuration config
const std::string & getActionEventId() const
Definition: widget.h:604
Visible mVisible
Definition: widget.h:962
const bool Visible_false
Definition: visible.h:29
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
void deleteKey(const std::string &key)
std::vector< ProgressBar * > mBars
void setValue(const std::string &key, const std::string &value)
std::vector< ProgressBar * >::const_iterator ProgressBarVectorCIter

◆ setIcon()

void MiniStatusWindow::setIcon ( const int  index,
AnimatedSprite *const  sprite 
)

Sets one of the icons.

Definition at line 235 of file ministatuswindow.cpp.

References CAST_S32, and mIcons.

Referenced by LocalPlayer::handleStatusEffect().

236 {
237  if (index >= CAST_S32(mIcons.size()))
238  mIcons.resize(index + 1, nullptr);
239 
240  delete mIcons[index];
241  mIcons[index] = sprite;
242 }
#define CAST_S32
Definition: cast.h:29
std::vector< AnimatedSprite * > mIcons

◆ showBar()

void MiniStatusWindow::showBar ( const std::string &  name,
const Visible  visible 
)

Definition at line 518 of file ministatuswindow.cpp.

References mBarNames, saveBars(), Widget::setVisible(), and updateBars().

Referenced by PopupMenu::handleLink().

520 {
521  ProgressBar *const bar = mBarNames[name];
522  if (bar == nullptr)
523  return;
524  bar->setVisible(visible);
525  updateBars();
526  saveBars();
527 }
std::map< std::string, ProgressBar * > mBarNames
void setVisible(Visible visible)
Definition: widget.cpp:224

◆ slotsChanged()

void MiniStatusWindow::slotsChanged ( const Inventory *const  inventory)
virtual

Implements InventoryListener.

Definition at line 580 of file ministatuswindow.cpp.

References Inventory::getType(), InventoryType::Inventory, mInvSlotsBar, and StatusWindow::updateInvSlotsBar().

581 {
582  if (inventory == nullptr)
583  return;
584 
585  if (inventory->getType() == InventoryType::Inventory)
587 }
static void updateInvSlotsBar(ProgressBar *const bar)
ProgressBar * mInvSlotsBar
InventoryTypeT getType() const
Definition: inventory.h:175

◆ statChanged()

void MiniStatusWindow::statChanged ( const AttributesT  id,
const int  oldVal1,
const int  oldVal2 
)
virtual

Implements StatListener.

Definition at line 268 of file ministatuswindow.cpp.

References mJobBar, mMpBar, statusWindow, StatusWindow::updateJobBar(), and StatusWindow::updateMPBar().

Referenced by getBars().

271 {
272  if (statusWindow != nullptr)
273  {
275  false);
276  }
278  true);
279 }
StatusWindow * statusWindow
void updateMPBar(ProgressBar *bar, const bool showMax) const
static void updateJobBar(ProgressBar *const bar, const bool percent)
ProgressBar * mJobBar
ProgressBar * mMpBar

◆ updateBars()

void MiniStatusWindow::updateBars ( )

Definition at line 206 of file ministatuswindow.cpp.

References BasicContainer2::add(), FOR_EACH, Widget::getHeight(), Widget::getWidth(), Widget::getX(), Widget::getY(), mBars, mMaxX, mSpacing, Widget::mVisible, Window::setContentSize(), Widget::setPosition(), Visible_true, and x.

Referenced by MiniStatusWindow(), and showBar().

207 {
208  int x = 0;
209  const ProgressBar *lastBar = nullptr;
211  remove(*it);
212 
214  {
215  ProgressBar *const bar = *it;
216  if (bar == nullptr)
217  continue;
218  if (bar->mVisible == Visible_true)
219  {
220  bar->setPosition(x, 0);
221  add(bar);
222  x += bar->getWidth() + mSpacing;
223  lastBar = bar;
224  }
225  }
226 
227  if (lastBar != nullptr)
228  {
229  setContentSize(lastBar->getX() + lastBar->getWidth(),
230  lastBar->getY() + lastBar->getHeight());
231  }
232  mMaxX = x;
233 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
int getWidth() const
Definition: widget.h:220
const bool Visible_true
Definition: visible.h:29
int getY() const
Definition: widget.h:287
Visible mVisible
Definition: widget.h:962
void setContentSize(int width, int height)
Definition: window.cpp:491
virtual void add(Widget *const widget)
void setPosition(const int x, const int y)
Definition: widget.cpp:160
int getX() const
Definition: widget.h:268
int getHeight() const
Definition: widget.h:239
std::vector< ProgressBar * > mBars
std::vector< ProgressBar * >::const_iterator ProgressBarVectorCIter

◆ updateStatus()

void MiniStatusWindow::updateStatus ( )
virtual

Implements UpdateStatusListener.

Definition at line 317 of file ministatuswindow.cpp.

References Popup::isPopupVisible(), mStatusBar, mStatusPopup, statusWindow, StatusPopup::update(), and StatusWindow::updateStatusBar().

Referenced by MiniStatusWindow().

318 {
319  if (statusWindow != nullptr)
320  {
322  true);
323  }
324  if ((mStatusPopup != nullptr) && mStatusPopup->isPopupVisible())
325  mStatusPopup->update();
326 }
ProgressBar * mStatusBar
StatusWindow * statusWindow
bool isPopupVisible() const
Definition: popup.h:173
void updateStatusBar(ProgressBar *const bar, const bool percent) const
StatusPopup * mStatusPopup
void update()
Definition: statuspopup.cpp:89

Field Documentation

◆ mArrowsBar

ProgressBar* MiniStatusWindow::mArrowsBar
private

Definition at line 139 of file ministatuswindow.h.

Referenced by arrowsChanged(), loadBars(), and MiniStatusWindow().

◆ mBarNames

std::map<std::string, ProgressBar*> MiniStatusWindow::mBarNames
private

Definition at line 126 of file ministatuswindow.h.

Referenced by createBar(), loadBars(), and showBar().

◆ mBars

std::vector<ProgressBar*> MiniStatusWindow::mBars
private

Definition at line 125 of file ministatuswindow.h.

Referenced by createBar(), getBars(), saveBars(), updateBars(), and ~MiniStatusWindow().

◆ mHpBar

ProgressBar* MiniStatusWindow::mHpBar
private

Definition at line 132 of file ministatuswindow.h.

Referenced by attributeChanged(), MiniStatusWindow(), and mouseMoved().

◆ mIconPadding

int MiniStatusWindow::mIconPadding
private

Definition at line 144 of file ministatuswindow.h.

Referenced by drawIcons().

◆ mIcons

std::vector<AnimatedSprite *> MiniStatusWindow::mIcons
private

Definition at line 127 of file ministatuswindow.h.

Referenced by drawIcons(), eraseIcon(), logic(), setIcon(), and ~MiniStatusWindow().

◆ mIconSpacing

int MiniStatusWindow::mIconSpacing
private

Definition at line 145 of file ministatuswindow.h.

Referenced by drawIcons().

◆ mInvSlotsBar

ProgressBar* MiniStatusWindow::mInvSlotsBar
private

Definition at line 137 of file ministatuswindow.h.

Referenced by loadBars(), mouseMoved(), and slotsChanged().

◆ mJobBar

ProgressBar* MiniStatusWindow::mJobBar
private

Definition at line 135 of file ministatuswindow.h.

Referenced by loadBars(), MiniStatusWindow(), mouseMoved(), and statChanged().

◆ mMaxX

int MiniStatusWindow::mMaxX
private

Definition at line 146 of file ministatuswindow.h.

Referenced by drawIcons(), and updateBars().

◆ mMoneyBar

ProgressBar* MiniStatusWindow::mMoneyBar
private

Definition at line 138 of file ministatuswindow.h.

Referenced by attributeChanged(), loadBars(), MiniStatusWindow(), and mouseMoved().

◆ mMpBar

ProgressBar* MiniStatusWindow::mMpBar
private

Definition at line 133 of file ministatuswindow.h.

Referenced by attributeChanged(), MiniStatusWindow(), mouseMoved(), and statChanged().

◆ mSpacing

int MiniStatusWindow::mSpacing
private

Definition at line 143 of file ministatuswindow.h.

Referenced by updateBars().

◆ mStatusBar

ProgressBar* MiniStatusWindow::mStatusBar
private

Definition at line 140 of file ministatuswindow.h.

Referenced by loadBars(), mouseMoved(), and updateStatus().

◆ mStatusPopup

StatusPopup* MiniStatusWindow::mStatusPopup
private

Definition at line 141 of file ministatuswindow.h.

Referenced by mouseExited(), mouseMoved(), updateStatus(), and ~MiniStatusWindow().

◆ mWeightBar

ProgressBar* MiniStatusWindow::mWeightBar
private

Definition at line 136 of file ministatuswindow.h.

Referenced by attributeChanged(), loadBars(), and mouseMoved().

◆ mXpBar

ProgressBar* MiniStatusWindow::mXpBar
private

Definition at line 134 of file ministatuswindow.h.

Referenced by attributeChanged(), MiniStatusWindow(), and mouseMoved().


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