summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-26 02:34:03 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-26 02:34:03 +0200
commitb2d7d2f28f86955f73b7246a4e14aef0be39d847 (patch)
treedd373211f8c033f3040aeed8aa8e55f0998a5951 /src
parent88d896d9bc248bc518fe447e43a95cb36a635446 (diff)
downloadmanaplus-b2d7d2f28f86955f73b7246a4e14aef0be39d847.tar.gz
manaplus-b2d7d2f28f86955f73b7246a4e14aef0be39d847.tar.bz2
manaplus-b2d7d2f28f86955f73b7246a4e14aef0be39d847.tar.xz
manaplus-b2d7d2f28f86955f73b7246a4e14aef0be39d847.zip
Add option to show/hide job messages.
Diffstat (limited to 'src')
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/gui/setup_other.cpp15
-rw-r--r--src/gui/setup_other.h3
-rw-r--r--src/localplayer.cpp8
-rw-r--r--src/localplayer.h1
5 files changed, 28 insertions, 0 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index c2a917c92..35d6eefa8 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -191,6 +191,7 @@ DefaultsData* getConfigDefaults()
AddDEF(configData, "showMobHP", true);
AddDEF(configData, "showOwnHP", true);
AddDEF(configData, "usePersistentIP", false);
+ AddDEF(configData, "showJobExp", true);
return configData;
}
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index 41a6c41ab..e7ddfcef0 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -63,6 +63,7 @@
#define ACTION_AUTO_SHOP "auto shop"
#define ACTION_SHOW_MOB_HP "show mob hp"
#define ACTION_SHOW_OWN_HP "show own hp"
+#define ACTION_SHOW_JOB_EXP "show job exp"
Setup_Other::Setup_Other():
mShowMonstersTakedDamage(config.getBoolValue("showMonstersTakedDamage")),
@@ -88,6 +89,7 @@ Setup_Other::Setup_Other():
mAutoShop(config.getBoolValue("autoShop")),
mShowMobHP(config.getBoolValue("showMobHP")),
mShowOwnHP(config.getBoolValue("showOwnHP")),
+ mShowJobExp(config.getBoolValue("showJobExp")),
mEditDialog(0)
{
setName(_("Misc"));
@@ -183,6 +185,10 @@ Setup_Other::Setup_Other():
mShowOwnHP,
this, ACTION_SHOW_OWN_HP);
+ mShowJobExpCheckBox = new CheckBox(_("Show job exp messages"),
+ mShowJobExp,
+ this, ACTION_SHOW_JOB_EXP);
+
// Do the layout
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
@@ -198,6 +204,7 @@ Setup_Other::Setup_Other():
place(12, 5, mAutoShopCheckBox, 10);
place(12, 6, mShowMobHPCheckBox, 10);
place(12, 7, mShowOwnHPCheckBox, 10);
+ place(12, 8, mShowJobExpCheckBox, 10);
place(0, 3, mFloorItemsHighlightCheckBox, 12);
place(0, 4, mHighlightAttackRangeCheckBox, 12);
place(0, 5, mHighlightMonsterAttackRangeCheckBox, 12);
@@ -330,6 +337,10 @@ void Setup_Other::action(const gcn::ActionEvent &event)
{
mShowOwnHP = mShowOwnHPCheckBox->isSelected();
}
+ else if (event.getId() == ACTION_SHOW_JOB_EXP)
+ {
+ mShowJobExp = mShowJobExpCheckBox->isSelected();
+ }
}
void Setup_Other::cancel()
@@ -402,6 +413,9 @@ void Setup_Other::cancel()
mShowOwnHP = config.getBoolValue("showOwnHP");
mShowOwnHPCheckBox->setSelected(mShowOwnHP);
+
+ mShowJobExp = config.getBoolValue("showJobExp");
+ mShowJobExpCheckBox->setSelected(mShowJobExp);
}
void Setup_Other::apply()
@@ -429,6 +443,7 @@ void Setup_Other::apply()
config.setValue("autoShop", mAutoShop);
config.setValue("showMobHP", mShowMobHP);
config.setValue("showOwnHP", mShowOwnHP);
+ config.setValue("showJobExp", mShowJobExp);
logger->setDebugLog(mDebugLog);
}
diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h
index 4f2930fd3..d73e679b8 100644
--- a/src/gui/setup_other.h
+++ b/src/gui/setup_other.h
@@ -113,6 +113,9 @@ class Setup_Other : public SetupTab, public gcn::ActionListener
gcn::CheckBox *mShowOwnHPCheckBox;
bool mShowOwnHP;
+ gcn::CheckBox *mShowJobExpCheckBox;
+ bool mShowJobExp;
+
EditDialog *mEditDialog;
};
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 438d978c4..29507c685 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -154,6 +154,7 @@ LocalPlayer::LocalPlayer(int id, int subtype):
mDrawPath = config.getBoolValue("drawPath");
mServerAttack = config.getBoolValue("serverAttack");
mAttackMoving = config.getBoolValue("attackMoving");
+ mShowJobExp = config.getBoolValue("showJobExp");
mPingSendTick = 0;
mWaitPing = false;
@@ -172,6 +173,7 @@ LocalPlayer::LocalPlayer(int id, int subtype):
config.addListener("drawPath", this);
config.addListener("serverAttack", this);
config.addListener("attackMoving", this);
+ config.addListener("showJobExp", this);
setShowName(config.getBoolValue("showownname"));
beingInfoCache.clear();
}
@@ -187,6 +189,7 @@ LocalPlayer::~LocalPlayer()
config.removeListener("drawPath", this);
config.removeListener("serverAttack", this);
config.removeListener("attackMoving", this);
+ config.removeListener("showJobExp", this);
delete mAwayDialog;
mAwayDialog = 0;
@@ -1476,6 +1479,8 @@ void LocalPlayer::optionChanged(const std::string &value)
mServerAttack = config.getBoolValue("serverAttack");
else if (value == "attackMoving")
mAttackMoving = config.getBoolValue("attackMoving");
+ else if (value == "showJobExp")
+ mShowJobExp = config.getBoolValue("showJobExp");
}
void LocalPlayer::event(Channels channel, const Mana::Event &event)
@@ -1507,6 +1512,9 @@ void LocalPlayer::event(Channels channel, const Mana::Event &event)
}
else if (event.getName() == EVENT_UPDATESTAT)
{
+ if (!mShowJobExp)
+ return;
+
int id = event.getInt("id");
if (id == Net::getPlayerHandler()->getJobLocation())
{
diff --git a/src/localplayer.h b/src/localplayer.h
index 189483e97..b9495b6ca 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -554,6 +554,7 @@ class LocalPlayer : public Being, public ActorSpriteListener,
bool mSyncPlayerMove;
bool mDrawPath;
bool mAttackMoving;
+ bool mShowJobExp;
int mActivityTime;
int mNavigateX;
int mNavigateY;