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="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
 
virtual ~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=0, int offsetY=0)
 
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=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
 
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 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 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=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 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 
125  if (statusWindow != nullptr)
127 
128  const bool job = serverConfig.getValueBool("showJob", true);
129 
131 
132  if (job)
133  {
134  mJobBar = createBar(0, 100, 0,
137  "jobprogressbar.xml", "jobprogressbar_fill.xml",
138  // TRANSLATORS: status bar name
139  "job bar", _("job bar"));
141  }
142 
143  loadBars();
144  updateBars();
145 
147  addMouseListener(this);
148  Inventory *const inv = PlayerInfo::getInventory();
149  if (inv != nullptr)
150  inv->addInventoyListener(this);
151 
154  updateStatus();
155 }
Net::PlayerHandler * playerHandler
Definition: net.cpp:89
#define _(s)
Definition: gettext.h:34
Skin * mSkin
Definition: window.h:641
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:207
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
static void updateHPBar(ProgressBar *const bar, const bool showMax=false)
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
static void updateXPBar(ProgressBar *const bar, const bool percent=true)
virtual void setVisible(Visible visible)
Definition: window.cpp:766
void updateMPBar(ProgressBar *bar, const bool showMax=false) const
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
Window(const std::string &caption="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
Definition: window.cpp:108
std::vector< ProgressBar * > mBars
ProgressBar * mJobBar
ProgressBar * mMpBar
static void updateJobBar(ProgressBar *const bar, const bool percent=true)
#define CREATEWIDGETR0(type)
Definition: createwidget.h:38

◆ ~MiniStatusWindow()

MiniStatusWindow::~MiniStatusWindow ( )

Definition at line 157 of file ministatuswindow.cpp.

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

158 {
161  mIcons.clear();
162 
163  Inventory *const inv = PlayerInfo::getInventory();
164  if (inv != nullptr)
165  inv->removeInventoyListener(this);
166 
168  {
169  ProgressBar *bar = *it;
170  if (bar == nullptr)
171  continue;
172  if (bar->mVisible == Visible_false)
173  delete bar;
174  }
175  mBars.clear();
176 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
Inventory * getInventory()
Definition: playerinfo.cpp:207
#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 582 of file ministatuswindow.cpp.

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

Referenced by getBars().

583 {
585 }
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 270 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().

273 {
274  PRAGMA45(GCC diagnostic push)
275  PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
276  switch (id)
277  {
281  break;
285  break;
289  break;
293  break;
294  case Attributes::MONEY:
296  break;
297  default:
298  break;
299  }
300  PRAGMA45(GCC diagnostic pop)
301 }
ProgressBar * mMoneyBar
static void updateWeightBar(ProgressBar *const bar)
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wunused-result") int TestLauncher
StatusWindow * statusWindow
ProgressBar * mWeightBar
static void updateHPBar(ProgressBar *const bar, const bool showMax=false)
static void updateMoneyBar(ProgressBar *const bar)
static void updateXPBar(ProgressBar *const bar, const bool percent=true)
void updateMPBar(ProgressBar *bar, const bool showMax=false) const
ProgressBar * mHpBar
ProgressBar * mXpBar
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 178 of file ministatuswindow.cpp.

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

Referenced by getBars(), and MiniStatusWindow().

188 {
189  ProgressBar *const bar = new ProgressBar(this,
190  progress, width, height, backColor, skin, skinFill);
191  bar->setActionEventId(name);
192  bar->setId(description);
193  bar->setColor(getThemeColor(textColor), getThemeColor(textColor + 1));
194  mBars.push_back(bar);
195  mBarNames[name] = bar;
196  return bar;
197 }
std::map< std::string, ProgressBar * > mBarNames
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha=255U) const A_INLINE
Definition: widget2.h:44
void setActionEventId(const std::string &actionEventId)
Definition: widget.h:595
void setId(const std::string &id)
Definition: widget.h:915
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 325 of file ministatuswindow.cpp.

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

326 {
327  BLOCK_START("MiniStatusWindow::draw")
328  drawChildren(graphics);
330 }
#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 246 of file ministatuswindow.cpp.

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

247 {
248  // Draw icons
249  int icon_x = mMaxX + mIconPadding;
250  for (size_t i = 0, sz = mIcons.size(); i < sz; i ++)
251  {
252  const AnimatedSprite *const icon = mIcons[i];
253  if (icon != nullptr)
254  {
255  icon->draw(graphics, icon_x, mIconPadding);
256  icon_x += mIconSpacing + icon->getWidth();
257  }
258  }
259 }
void draw(Graphics *const graphics, const int posX, const int posY) const
int getWidth() const
std::vector< AnimatedSprite * > mIcons

◆ eraseIcon()

void MiniStatusWindow::eraseIcon ( const int  index)

Definition at line 237 of file ministatuswindow.cpp.

References CAST_S32, and mIcons.

Referenced by LocalPlayer::handleStatusEffect().

238 {
239  if (index < CAST_S32(mIcons.size()))
240  {
241  delete mIcons[index];
242  mIcons.erase(mIcons.begin() + index);
243  }
244 }
#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 572 of file ministatuswindow.cpp.

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

Referenced by getBars().

573 {
574  const int padding = mPadding;
575  const int padding2 = padding * 2;
576  const Rect &rect = mDimension;
577  return Rect(padding, padding,
578  rect.width - padding2,
579  rect.height - padding2);
580 }
int width
Definition: rect.h:218
int mPadding
Definition: window.h:610
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 512 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().

513 {
514  if (config.getIntValue("ministatussaved") == 0)
515  {
516  if (mWeightBar != nullptr)
518  if (mInvSlotsBar != nullptr)
520  if (mMoneyBar != nullptr)
522  if (mArrowsBar != nullptr)
524  if (mStatusBar != nullptr)
526  if (mJobBar != nullptr)
528  return;
529  }
530 
531  for (int f = 0; f < 10; f ++)
532  {
533  const std::string str = config.getValue(
534  "ministatus" + toString(f), "");
535  if (str.empty())
536  continue;
537  ProgressBar *const bar = mBarNames[str];
538  if (bar == nullptr)
539  continue;
541  }
542 }
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 311 of file ministatuswindow.cpp.

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

312 {
313  BLOCK_START("MiniStatusWindow::logic")
314  Window::logic();
315 
316  for (size_t i = 0, sz = mIcons.size(); i < sz; i++)
317  {
318  AnimatedSprite *const icon = mIcons[i];
319  if (icon != nullptr)
320  icon->update(tick_time * 10);
321  }
322  BLOCK_END("MiniStatusWindow::logic")
323 }
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 493 of file ministatuswindow.cpp.

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

494 {
495  Window::mouseExited(event);
496 
497  textPopup->hide();
498  mStatusPopup->hide();
499 }
void hide()
Definition: popup.cpp:259
StatusPopup * mStatusPopup
void mouseExited(MouseEvent &event)
Definition: window.cpp:912
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 339 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.

340 {
341  Window::mouseMoved(event);
342 
343  const int x = event.getX();
344  const int y = event.getY();
345 
346  const Rect &rect = mDimension;
347  if (event.getSource() == mStatusBar)
348  {
349  mStatusPopup->view(x + rect.x, y + rect.y);
350  textPopup->hide();
351  }
352  else if (event.getSource() == mXpBar)
353  {
354  std::string level;
355  if ((localPlayer != nullptr) && localPlayer->isGM())
356  {
357  // TRANSLATORS: status bar label
358  level = strprintf(_("Level: %d (GM %d)"),
361  }
362  else
363  {
364  // TRANSLATORS: status bar label
365  level = strprintf(_("Level: %d"),
367  }
368 
370  const int64_t expNeed = PlayerInfo::getAttribute64(
372  const std::string str = toString(CAST_U64(exp)) +
373  "/" +
374  toString(CAST_U64(expNeed));
375  if (exp > expNeed)
376  {
377  textPopup->show(x + rect.x,
378  y + rect.y,
379  level,
380  str);
381  }
382  else
383  {
384  const std::string str2 = toString(CAST_U64(expNeed - exp));
385  textPopup->show(x + rect.x,
386  y + rect.y,
387  level,
388  str,
389  // TRANSLATORS: status bar label
390  strprintf("%s: %s", _("Need"), str2.c_str()));
391  }
392  mStatusPopup->hide();
393  }
394  else if (event.getSource() == mHpBar)
395  {
396  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
399  mStatusPopup->hide();
400  }
401  else if (event.getSource() == mMpBar)
402  {
403  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
406  mStatusPopup->hide();
407  }
408  else if (event.getSource() == mJobBar)
409  {
410  const int64_t exp = PlayerInfo::getAttribute64(
412  const int64_t expNeed = PlayerInfo::getAttribute64(
414  const int32_t jobLevel = PlayerInfo::getAttribute(
416  const std::string expStr = toString(CAST_U64(exp));
417  const std::string expNeedStr = toString(CAST_U64(expNeed));
418  const std::string expLeftStr = toString(CAST_U64(expNeed - exp));
419 
420  // TRANSLATORS: job bar label
421  const std::string level = strprintf(_("Job level: %d"),
422  jobLevel);
423 
424  if (exp > expNeed)
425  {
426  textPopup->show(x + rect.x,
427  y + rect.y,
428  level,
429  strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str()));
430  }
431  else
432  {
433  textPopup->show(x + rect.x,
434  y + rect.y,
435  level,
436  strprintf("%s/%s", expStr.c_str(), expNeedStr.c_str()),
437  // TRANSLATORS: status bar label
438  strprintf("%s: %s", _("Need"), expLeftStr.c_str()));
439  }
440  mStatusPopup->hide();
441  }
442  else if (event.getSource() == mWeightBar)
443  {
444  textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
448  mStatusPopup->hide();
449  }
450  else if (event.getSource() == mInvSlotsBar)
451  {
452  const Inventory *const inv = PlayerInfo::getInventory();
453  if (inv != nullptr)
454  {
455  const int usedSlots = inv->getNumberOfSlotsUsed();
456  const int maxSlots = inv->getSize();
457  textPopup->show(x + rect.x, y + rect.y,
458  event.getSource()->getId(),
459  strprintf("%d/%d", usedSlots, maxSlots));
460  }
461  mStatusPopup->hide();
462  }
463  else if (event.getSource() == mMoneyBar)
464  {
465  textPopup->show(x + rect.x, y + rect.y,
466  event.getSource()->getId(),
468  }
469  else
470  {
471  textPopup->hide();
472  mStatusPopup->hide();
473  }
474 }
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:207
void mouseMoved(MouseEvent &event)
Definition: window.cpp:955
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:259
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:1085
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:654
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 476 of file ministatuswindow.cpp.

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

477 {
478  if (event.getButton() == MouseButton::RIGHT)
479  {
480  const ProgressBar *const bar = dynamic_cast<ProgressBar*>(
481  event.getSource());
482  if (bar == nullptr)
483  return;
484  event.consume();
485  if (popupManager != nullptr)
486  {
487  popupMenu->showPopup(getX() + event.getX(),
488  getY() + event.getY(), bar);
489  }
490  }
491 }
int getY() const
Definition: widget.h:287
MouseButtonT getButton() const
Definition: mouseevent.h:113
PopupManager * popupManager
PopupMenu * popupMenu
Definition: popupmenu.cpp:102
int getX() const
Definition: widget.h:268
int getX() const
Definition: mouseevent.h:124
void showPopup(const int x, const int y, const Being *const being)
Definition: popupmenu.cpp:201

◆ safeDraw()

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

Reimplemented from Window.

Definition at line 332 of file ministatuswindow.cpp.

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

333 {
334  BLOCK_START("MiniStatusWindow::draw")
335  safeDrawChildren(graphics);
337 }
#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 544 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().

545 {
546  int i = 0;
548  {
549  const ProgressBar *const bar = *it;
550  if (bar->mVisible == Visible_false)
551  {
552  config.setValue("ministatus" + toString(i),
553  bar->getActionEventId());
554  i ++;
555  }
556  }
557  for (int f = i; f < 10; f ++)
558  config.deleteKey("ministatus" + toString(f));
559 
560  config.setValue("ministatussaved", true);
561 }
#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 228 of file ministatuswindow.cpp.

References CAST_S32, and mIcons.

Referenced by LocalPlayer::handleStatusEffect().

229 {
230  if (index >= CAST_S32(mIcons.size()))
231  mIcons.resize(index + 1, nullptr);
232 
233  delete mIcons[index];
234  mIcons[index] = sprite;
235 }
#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 501 of file ministatuswindow.cpp.

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

Referenced by PopupMenu::handleLink().

503 {
504  ProgressBar *const bar = mBarNames[name];
505  if (bar == nullptr)
506  return;
507  bar->setVisible(visible);
508  updateBars();
509  saveBars();
510 }
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 563 of file ministatuswindow.cpp.

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

564 {
565  if (inventory == nullptr)
566  return;
567 
568  if (inventory->getType() == InventoryType::Inventory)
570 }
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 261 of file ministatuswindow.cpp.

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

Referenced by getBars().

264 {
265  if (statusWindow != nullptr)
268 }
StatusWindow * statusWindow
void updateMPBar(ProgressBar *bar, const bool showMax=false) const
ProgressBar * mJobBar
ProgressBar * mMpBar
static void updateJobBar(ProgressBar *const bar, const bool percent=true)

◆ updateBars()

void MiniStatusWindow::updateBars ( )

Definition at line 199 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().

200 {
201  int x = 0;
202  const ProgressBar *lastBar = nullptr;
204  remove(*it);
205 
207  {
208  ProgressBar *const bar = *it;
209  if (bar == nullptr)
210  continue;
211  if (bar->mVisible == Visible_true)
212  {
213  bar->setPosition(x, 0);
214  add(bar);
215  x += bar->getWidth() + mSpacing;
216  lastBar = bar;
217  }
218  }
219 
220  if (lastBar != nullptr)
221  {
222  setContentSize(lastBar->getX() + lastBar->getWidth(),
223  lastBar->getY() + lastBar->getHeight());
224  }
225  mMaxX = x;
226 }
#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:484
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 303 of file ministatuswindow.cpp.

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

Referenced by MiniStatusWindow().

304 {
305  if (statusWindow != nullptr)
307  if ((mStatusPopup != nullptr) && mStatusPopup->isPopupVisible())
308  mStatusPopup->update();
309 }
ProgressBar * mStatusBar
StatusWindow * statusWindow
bool isPopupVisible() const
Definition: popup.h:173
StatusPopup * mStatusPopup
void updateStatusBar(ProgressBar *const bar, const bool percent=true) const
void update()
Definition: statuspopup.cpp:88

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: