From b2d7d2f28f86955f73b7246a4e14aef0be39d847 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Jan 2011 02:34:03 +0200 Subject: Add option to show/hide job messages. --- src/defaults.cpp | 1 + src/gui/setup_other.cpp | 15 +++++++++++++++ src/gui/setup_other.h | 3 +++ src/localplayer.cpp | 8 ++++++++ src/localplayer.h | 1 + 5 files changed, 28 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-60-g2f50