summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-14 21:13:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-14 21:13:38 +0300
commit6c3ab80385465cdaf88643fd964706827e2b61d6 (patch)
tree26cfa5f50e7712c078586efadb3281b207d40a5a
parente74f40d96ed90750dd917d777a8621416084f019 (diff)
downloadplus-6c3ab80385465cdaf88643fd964706827e2b61d6.tar.gz
plus-6c3ab80385465cdaf88643fd964706827e2b61d6.tar.bz2
plus-6c3ab80385465cdaf88643fd964706827e2b61d6.tar.xz
plus-6c3ab80385465cdaf88643fd964706827e2b61d6.zip
fix status icons draw if yellow bar is hidden.
-rw-r--r--src/gui/ministatuswindow.cpp4
-rw-r--r--src/gui/ministatuswindow.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp
index 4cdf64f33..f1421af3e 100644
--- a/src/gui/ministatuswindow.cpp
+++ b/src/gui/ministatuswindow.cpp
@@ -56,6 +56,7 @@ MiniStatusWindow::MiniStatusWindow() :
mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3),
mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3),
mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2),
+ mMaxX(0),
mHpBar(createBar(0, 100, 0, Theme::PROG_HP, "hp bar", _("health bar"))),
mMpBar(Net::getGameHandler()->canUseMagicBar()
? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic()
@@ -177,6 +178,7 @@ void MiniStatusWindow::updateBars()
setContentSize(lastBar->getX() + lastBar->getWidth(),
lastBar->getY() + lastBar->getHeight());
}
+ mMaxX = x;
}
void MiniStatusWindow::setIcon(const int index, AnimatedSprite *const sprite)
@@ -201,7 +203,7 @@ void MiniStatusWindow::eraseIcon(const int index)
void MiniStatusWindow::drawIcons(Graphics *const graphics)
{
// Draw icons
- int icon_x = mStatusBar->getX() + mStatusBar->getWidth() + mIconPadding;
+ int icon_x = mMaxX + mIconPadding;
for (size_t i = 0, sz = mIcons.size(); i < sz; i ++)
{
if (mIcons[i])
diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h
index fcd18b479..d8d4347e3 100644
--- a/src/gui/ministatuswindow.h
+++ b/src/gui/ministatuswindow.h
@@ -108,6 +108,7 @@ class MiniStatusWindow final : public Popup,
int mSpacing;
int mIconPadding;
int mIconSpacing;
+ int mMaxX;
/*
* Mini Status Bars