summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 14:38:05 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 14:38:05 +0300
commit1338c1f3e191095a220f0b14a884a385fa8bc915 (patch)
tree0a32dd62f76cfaa4d98caff47374def37c42313e /src
parent3f815d7ae9767416b6205e521cc3f06bc4299fcf (diff)
downloadmanaplus-1338c1f3e191095a220f0b14a884a385fa8bc915.tar.gz
manaplus-1338c1f3e191095a220f0b14a884a385fa8bc915.tar.bz2
manaplus-1338c1f3e191095a220f0b14a884a385fa8bc915.tar.xz
manaplus-1338c1f3e191095a220f0b14a884a385fa8bc915.zip
Use public text popup in ministatus window.
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/ministatuswindow.cpp27
-rw-r--r--src/gui/windows/ministatuswindow.h1
2 files changed, 12 insertions, 16 deletions
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index ebbb90119..618e8fb74 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -109,14 +109,12 @@ MiniStatusWindow::MiniStatusWindow() :
"statusprogressbar.xml", "statusprogressbar_fill.xml",
// TRANSLATORS: status bar name
"status bar", _("status bar"))),
- mTextPopup(new TextPopup),
mStatusPopup(new StatusPopup),
mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3),
mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3),
mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2),
mMaxX(0)
{
- mTextPopup->postInit();
mStatusPopup->postInit();
StatusWindow::updateHPBar(mHpBar);
@@ -154,7 +152,6 @@ MiniStatusWindow::MiniStatusWindow() :
MiniStatusWindow::~MiniStatusWindow()
{
- delete2(mTextPopup);
delete2(mStatusPopup);
delete_all(mIcons);
mIcons.clear();
@@ -334,7 +331,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
if (event.getSource() == mStatusBar)
{
mStatusPopup->view(x + rect.x, y + rect.y);
- mTextPopup->hide();
+ textPopup->hide();
}
else if (event.getSource() == mXpBar)
{
@@ -357,12 +354,12 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
const int expNeed = PlayerInfo::getAttribute(Attributes::EXP_NEEDED);
if (exp > expNeed)
{
- mTextPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d",
+ textPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d",
exp, expNeed));
}
else
{
- mTextPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d",
+ textPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d",
exp, expNeed),
// TRANSLATORS: status bar label
strprintf("%s: %d", _("Need"), expNeed - exp));
@@ -371,14 +368,14 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
}
else if (event.getSource() == mHpBar)
{
- mTextPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
+ textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::HP),
PlayerInfo::getAttribute(Attributes::MAX_HP)));
mStatusPopup->hide();
}
else if (event.getSource() == mMpBar)
{
- mTextPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
+ textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::MP),
PlayerInfo::getAttribute(Attributes::MAX_MP)));
mStatusPopup->hide();
@@ -395,12 +392,12 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
if (exp.first > exp.second)
{
- mTextPopup->show(x + rect.x, y + rect.y, level,
+ textPopup->show(x + rect.x, y + rect.y, level,
strprintf("%d/%d", exp.first, exp.second));
}
else
{
- mTextPopup->show(x + rect.x, y + rect.y, level,
+ textPopup->show(x + rect.x, y + rect.y, level,
strprintf("%d/%d", exp.first, exp.second),
// TRANSLATORS: status bar label
strprintf("%s: %d", _("Need"), exp.second - exp.first));
@@ -409,7 +406,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
}
else if (event.getSource() == mWeightBar)
{
- mTextPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
+ textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
strprintf("%d/%d", PlayerInfo::getAttribute(
Attributes::TOTAL_WEIGHT),
PlayerInfo::getAttribute(Attributes::MAX_WEIGHT)));
@@ -422,7 +419,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
{
const int usedSlots = inv->getNumberOfSlotsUsed();
const int maxSlots = inv->getSize();
- mTextPopup->show(x + rect.x, y + rect.y,
+ textPopup->show(x + rect.x, y + rect.y,
event.getSource()->getId(),
strprintf("%d/%d", usedSlots, maxSlots));
}
@@ -430,13 +427,13 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
}
else if (event.getSource() == mMoneyBar)
{
- mTextPopup->show(x + rect.x, y + rect.y,
+ textPopup->show(x + rect.x, y + rect.y,
event.getSource()->getId(),
toString(PlayerInfo::getAttribute(Attributes::MONEY)));
}
else
{
- mTextPopup->hide();
+ textPopup->hide();
mStatusPopup->hide();
}
}
@@ -462,7 +459,7 @@ void MiniStatusWindow::mouseExited(MouseEvent &event)
{
Window::mouseExited(event);
- mTextPopup->hide();
+ textPopup->hide();
mStatusPopup->hide();
}
diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h
index add4ea6b6..e97d90ed0 100644
--- a/src/gui/windows/ministatuswindow.h
+++ b/src/gui/windows/ministatuswindow.h
@@ -137,7 +137,6 @@ class MiniStatusWindow final : public Window,
ProgressBar *mMoneyBar;
ProgressBar *mArrowsBar;
ProgressBar *mStatusBar;
- TextPopup *mTextPopup;
StatusPopup *mStatusPopup;
int mSpacing;