summaryrefslogtreecommitdiff
path: root/src/gui/ministatuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-06 20:57:24 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-06 22:58:35 +0300
commit4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f (patch)
treea776928bb1339cdd29eb2e54d50eb3fa6e3448d7 /src/gui/ministatuswindow.cpp
parent22ed653d8b630c813333d5c73a4ca02dede2a5a5 (diff)
downloadmanaplus-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.gz
manaplus-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.bz2
manaplus-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.xz
manaplus-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.zip
Improve constructors in some classes.
Diffstat (limited to 'src/gui/ministatuswindow.cpp')
-rw-r--r--src/gui/ministatuswindow.cpp42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp
index 2c4fdda9c..9f9f63a86 100644
--- a/src/gui/ministatuswindow.cpp
+++ b/src/gui/ministatuswindow.cpp
@@ -50,12 +50,27 @@
extern volatile int tick_time;
-MiniStatusWindow::MiniStatusWindow():
- Popup("MiniStatus", "ministatus.xml")
+MiniStatusWindow::MiniStatusWindow() :
+ Popup("MiniStatus", "ministatus.xml"),
+ InventoryListener(),
+ mHpBar(createBar(0, 100, 20, Theme::PROG_HP, "hp bar", _("health bar"))),
+ mXpBar(createBar(0, 100, 20, Theme::PROG_EXP,
+ "xp bar", _("experience bar"))),
+ mWeightBar(createBar(0, 140, 20, Theme::PROG_WEIGHT,
+ "weight bar", _("weight bar"))),
+ mInvSlotsBar(createBar(0, 45, 20, Theme::PROG_INVY_SLOTS,
+ "inventory slots bar", _("inventory slots bar"))),
+ mMoneyBar(createBar(0, 130, 20, Theme::PROG_INVY_SLOTS,
+ "money bar", _("money bar"))),
+ mArrowsBar(createBar(0, 50, 20, Theme::PROG_INVY_SLOTS,
+ "arrows bar", _("arrows bar"))),
+ mStatusBar(createBar(100, 165, 20, Theme::PROG_EXP,
+ "status bar", _("status bar"))),
+ mTextPopup(new TextPopup),
+ mStatusPopup(new StatusPopup)
{
listen(CHANNEL_ATTRIBUTES);
- mHpBar = createBar(0, 100, 20, Theme::PROG_HP, "hp bar", _("health bar"));
StatusWindow::updateHPBar(mHpBar);
if (Net::getGameHandler()->canUseMagicBar())
@@ -72,8 +87,6 @@ MiniStatusWindow::MiniStatusWindow():
const int job = Net::getPlayerHandler()->getJobLocation()
&& serverConfig.getValueBool("showJob", false);
- mXpBar = createBar(0, 100, 20, Theme::PROG_EXP,
- "xp bar", _("experience bar"));
StatusWindow::updateXPBar(mXpBar);
if (job)
@@ -87,29 +100,10 @@ MiniStatusWindow::MiniStatusWindow():
mJobBar = nullptr;
}
- mWeightBar = createBar(0, 140, 20, Theme::PROG_WEIGHT,
- "weight bar", _("weight bar"));
-
- mInvSlotsBar = createBar(0, 45, 20, Theme::PROG_INVY_SLOTS,
- "inventory slots bar", _("inventory slots bar"));
-
- mMoneyBar = createBar(0, 130, 20, Theme::PROG_INVY_SLOTS,
- "money bar", _("money bar"));
-
- mArrowsBar = createBar(0, 50, 20, Theme::PROG_INVY_SLOTS,
- "arrows bar", _("arrows bar"));
-
- mStatusBar = createBar(100, 165, 20, Theme::PROG_EXP,
- "status bar", _("status bar"));
-
loadBars();
updateBars();
setVisible(config.getValueBool(getPopupName() + "Visible", true));
-
- mStatusPopup = new StatusPopup();
- mTextPopup = new TextPopup();
-
addMouseListener(this);
Inventory *const inv = PlayerInfo::getInventory();
if (inv)