summaryrefslogtreecommitdiff
path: root/src/gui/ministatuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-15 18:37:00 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-15 18:37:00 +0300
commit65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635 (patch)
tree493d6441dd152419908d28178c26112a4639e89f /src/gui/ministatuswindow.cpp
parente1e411459e9c9aae819eee474d48d0cc20f6ca07 (diff)
downloadmv-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.gz
mv-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.bz2
mv-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.tar.xz
mv-65f11a2d85f26932b0e2f0679ddbfc6b6fc4b635.zip
Fix code style.
Diffstat (limited to 'src/gui/ministatuswindow.cpp')
-rw-r--r--src/gui/ministatuswindow.cpp81
1 files changed, 43 insertions, 38 deletions
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp
index 9ac37a413..54ededd41 100644
--- a/src/gui/ministatuswindow.cpp
+++ b/src/gui/ministatuswindow.cpp
@@ -227,16 +227,27 @@ void MiniStatusWindow::processEvent(Channels channel A_UNUSED,
if (event.getName() == EVENT_UPDATEATTRIBUTE)
{
int id = event.getInt("id");
- if (id == HP || id == MAX_HP)
+ if (id == PlayerInfo::HP || id == PlayerInfo::MAX_HP)
+ {
StatusWindow::updateHPBar(mHpBar);
- else if (id == MP || id == MAX_MP)
+ }
+ else if (id == PlayerInfo::MP || id == PlayerInfo::MAX_MP)
+ {
StatusWindow::updateMPBar(mMpBar);
- else if (id == EXP || id == EXP_NEEDED)
+ }
+ else if (id == PlayerInfo::EXP || id == PlayerInfo::EXP_NEEDED)
+ {
StatusWindow::updateXPBar(mXpBar);
- else if (id == TOTAL_WEIGHT || id == MAX_WEIGHT)
+ }
+ else if (id == PlayerInfo::TOTAL_WEIGHT
+ || id == PlayerInfo::MAX_WEIGHT)
+ {
StatusWindow::updateWeightBar(mWeightBar);
- else if (id == MONEY)
+ }
+ else if (id == PlayerInfo::MONEY)
+ {
StatusWindow::updateMoneyBar(mMoneyBar);
+ }
}
else if (event.getName() == EVENT_UPDATESTAT)
{
@@ -282,40 +293,38 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
}
else if (event.getSource() == mXpBar)
{
- if (PlayerInfo::getAttribute(EXP)
- > PlayerInfo::getAttribute(EXP_NEEDED))
+ if (PlayerInfo::getAttribute(PlayerInfo::EXP)
+ > PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED))
{
mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
- PlayerInfo::getAttribute(EXP_NEEDED)));
+ event.getSource()->getId(), strprintf("%u/%u",
+ PlayerInfo::getAttribute(PlayerInfo::EXP),
+ PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED)));
}
else
{
mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
- PlayerInfo::getAttribute(EXP_NEEDED)),
- strprintf("%s: %u", _("Need"),
- PlayerInfo::getAttribute(EXP_NEEDED)
- - PlayerInfo::getAttribute(EXP)));
+ event.getSource()->getId(), strprintf("%u/%u",
+ PlayerInfo::getAttribute(PlayerInfo::EXP),
+ PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED)),
+ strprintf("%s: %u", _("Need"),
+ PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED)
+ - PlayerInfo::getAttribute(PlayerInfo::EXP)));
}
mStatusPopup->hide();
}
else if (event.getSource() == mHpBar)
{
- mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", PlayerInfo::getAttribute(HP),
- PlayerInfo::getAttribute(MAX_HP)));
+ mTextPopup->show(x + getX(), y + getY(), event.getSource()->getId(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(PlayerInfo::HP),
+ PlayerInfo::getAttribute(PlayerInfo::MAX_HP)));
mStatusPopup->hide();
}
else if (event.getSource() == mMpBar)
{
- mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", PlayerInfo::getAttribute(MP),
- PlayerInfo::getAttribute(MAX_MP)));
+ mTextPopup->show(x + getX(), y + getY(), event.getSource()->getId(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(PlayerInfo::MP),
+ PlayerInfo::getAttribute(PlayerInfo::MAX_MP)));
mStatusPopup->hide();
}
else if (event.getSource() == mJobBar)
@@ -326,28 +335,24 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
if (exp.first > exp.second)
{
mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", exp.first,
- exp.second));
+ event.getSource()->getId(),
+ strprintf("%u/%u", exp.first, exp.second));
}
else
{
mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", exp.first,
- exp.second),
- strprintf("%s: %u", _("Need"),
- exp.second
- - exp.first));
+ event.getSource()->getId(),
+ strprintf("%u/%u", exp.first, exp.second),
+ strprintf("%s: %u", _("Need"), exp.second - exp.first));
}
mStatusPopup->hide();
}
else if (event.getSource() == mWeightBar)
{
- mTextPopup->show(x + getX(), y + getY(),
- event.getSource()->getId(),
- strprintf("%u/%u", PlayerInfo::getAttribute(TOTAL_WEIGHT),
- PlayerInfo::getAttribute(MAX_WEIGHT)));
+ mTextPopup->show(x + getX(), y + getY(), event.getSource()->getId(),
+ strprintf("%u/%u", PlayerInfo::getAttribute(
+ PlayerInfo::TOTAL_WEIGHT),
+ PlayerInfo::getAttribute(PlayerInfo::MAX_WEIGHT)));
mStatusPopup->hide();
}
else if (event.getSource() == mInvSlotsBar)
@@ -368,7 +373,7 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
{
mTextPopup->show(x + getX(), y + getY(),
event.getSource()->getId(),
- toString(PlayerInfo::getAttribute(MONEY)));
+ toString(PlayerInfo::getAttribute(PlayerInfo::MONEY)));
}
else
{