summaryrefslogtreecommitdiff
path: root/src/gui/setup_other.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-05 22:56:42 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-05 22:56:42 +0200
commit1c49a83df05dbf6837687e1bfc5b142a680144ed (patch)
tree5e1ae2d371ca8ec6aa5caa95cf8e4bee00f726ee /src/gui/setup_other.cpp
parent6941cbc58099ee54ba326382eaf4de805d933e0e (diff)
downloadplus-1c49a83df05dbf6837687e1bfc5b142a680144ed.tar.gz
plus-1c49a83df05dbf6837687e1bfc5b142a680144ed.tar.bz2
plus-1c49a83df05dbf6837687e1bfc5b142a680144ed.tar.xz
plus-1c49a83df05dbf6837687e1bfc5b142a680144ed.zip
Add hp bar to local player.
Diffstat (limited to 'src/gui/setup_other.cpp')
-rw-r--r--src/gui/setup_other.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index 54ec1c65d..5a2b77a81 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -63,6 +63,7 @@
#define ACTION_WARP_PARTICLE "warp particle"
#define ACTION_AUTO_SHOP "auto shop"
#define ACTION_SHOW_MOB_HP "show mob hp"
+#define ACTION_SHOW_OWN_HP "show own hp"
Setup_Other::Setup_Other():
mShowMonstersTakedDamage(config.getBoolValue("showMonstersTakedDamage")),
@@ -87,7 +88,8 @@ Setup_Other::Setup_Other():
mQuickStats(config.getBoolValue("quickStats")),
mWarpParticle(config.getBoolValue("warpParticle")),
mAutoShop(config.getBoolValue("autoShop")),
- mShowMobHP(config.getBoolValue("showMobHP"))
+ mShowMobHP(config.getBoolValue("showMobHP")),
+ mShowOwnHP(config.getBoolValue("showOwnHP"))
{
setName(_("Misc"));
@@ -178,6 +180,10 @@ Setup_Other::Setup_Other():
mShowMobHP,
this, ACTION_SHOW_MOB_HP);
+ mShowOwnHPCheckBox = new CheckBox(_("Show own hp bar"),
+ mShowOwnHP,
+ this, ACTION_SHOW_OWN_HP);
+
// Do the layout
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -192,6 +198,7 @@ Setup_Other::Setup_Other():
place(12, 4, mWarpParticleCheckBox, 10);
place(12, 5, mAutoShopCheckBox, 10);
place(12, 6, mShowMobHPCheckBox, 10);
+ place(12, 7, mShowOwnHPCheckBox, 10);
place(0, 3, mFloorItemsHighlightCheckBox, 12);
place(0, 4, mHighlightAttackRangeCheckBox, 12);
place(0, 5, mHighlightMonsterAttackRangeCheckBox, 12);
@@ -320,6 +327,10 @@ void Setup_Other::action(const gcn::ActionEvent &event)
{
mShowMobHP = mShowMobHPCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_SHOW_OWN_HP)
+ {
+ mShowOwnHP = mShowOwnHPCheckBox->isSelected();
+ }
}
void Setup_Other::cancel()
@@ -389,6 +400,9 @@ void Setup_Other::cancel()
mShowMobHP = config.getBoolValue("showMobHP");
mShowMobHPCheckBox->setSelected(mShowMobHP);
+
+ mShowOwnHP = config.getBoolValue("showOwnHP");
+ mShowOwnHPCheckBox->setSelected(mShowOwnHP);
}
void Setup_Other::apply()
@@ -416,6 +430,7 @@ void Setup_Other::apply()
config.setValue("warpParticle", mWarpParticle);
config.setValue("autoShop", mAutoShop);
config.setValue("showMobHP", mShowMobHP);
+ config.setValue("showOwnHP", mShowOwnHP);
logger->setDebugLog(mDebugLog);
}