diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-27 12:38:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-27 12:38:32 +0300 |
commit | 4fb756ef90981a90ae31446c1c094bf88e24d045 (patch) | |
tree | 31cb8a3d46987207c8948987a66e9361f7f0f648 | |
parent | 8626395ecd1bb47f2e67e576ec648c2ab34cb148 (diff) | |
download | manaplus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.gz manaplus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.bz2 manaplus-4fb756ef90981a90ae31446c1c094bf88e24d045.tar.xz manaplus-4fb756ef90981a90ae31446c1c094bf88e24d045.zip |
Add option to show/hide server side position.
By default server side position is hidden,
before it was always visible.
-rw-r--r-- | src/being/localplayer.cpp | 11 | ||||
-rw-r--r-- | src/being/localplayer.h | 1 | ||||
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 4 |
4 files changed, 14 insertions, 3 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 55e7baca9..2e09f1690 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -161,6 +161,7 @@ LocalPlayer::LocalPlayer(const int id, const int subtype) : mAttackMoving(config.getBoolValue("attackMoving")), mAttackNext(config.getBoolValue("attackNext")), mShowJobExp(config.getBoolValue("showJobExp")), + mShowServerPos(config.getBoolValue("showserverpos")), mNextStep(false), mDisableCrazyMove(false), mGoingToTarget(false), @@ -202,6 +203,7 @@ LocalPlayer::LocalPlayer(const int id, const int subtype) : config.addListener("enableAdvert", this); config.addListener("tradebot", this); config.addListener("targetOnlyReachable", this); + config.addListener("showserverpos", this); setShowName(config.getBoolValue("showownname")); } @@ -1019,6 +1021,8 @@ void LocalPlayer::optionChanged(const std::string &value) mTradebot = config.getBoolValue("tradebot"); else if (value == "targetOnlyReachable") mTargetOnlyReachable = config.getBoolValue("targetOnlyReachable"); + else if (value == "showserverpos") + mShowServerPos = config.getBoolValue("showserverpos"); } void LocalPlayer::processEvent(const Channels channel, @@ -3552,14 +3556,15 @@ void LocalPlayer::setRealPos(const int x, const int y) { fixPos(1); - if ((mCrossX || mCrossY) && layer->getTile(mCrossX, mCrossY) + if ((mCrossX || mCrossY) + && layer->getTile(mCrossX, mCrossY) && layer->getTile(mCrossX, mCrossY)->getType() == MapItem::CROSS) { layer->setTile(mCrossX, mCrossY, MapItem::EMPTY); } - if (!layer->getTile(x, y) - || layer->getTile(x, y)->getType() == MapItem::EMPTY) + if (mShowServerPos && (!layer->getTile(x, y) + || layer->getTile(x, y)->getType() == MapItem::EMPTY)) { if (getTileX() != x && getTileY() != y) layer->setTile(x, y, MapItem::CROSS); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 5664b03b6..e3a235b06 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -651,6 +651,7 @@ class LocalPlayer final : public Being, bool mAwayMode; bool mPseudoAwayMode; bool mShowNavigePath; + bool mShowServerPos; }; extern LocalPlayer *player_node; diff --git a/src/defaults.cpp b/src/defaults.cpp index 9601c4346..7e2e22769 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -362,6 +362,7 @@ DefaultsData* getConfigDefaults() AddDEF("scale", 1); AddDEF("addwatermark", true); AddDEF("hidesupport", false); + AddDEF("showserverpos", false); return configData; } diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index ad1f60c8b..12cb614cd 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -182,6 +182,10 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : "autofixPos", this, "autofixPosEvent"); // TRANSLATORS: settings option + new SetupItemCheckBox(_("Show server side position"), "", + "showserverpos", this, "showserverposEvent"); + + // TRANSLATORS: settings option new SetupItemCheckBox(_("Attack while moving"), "", "attackMoving", this, "attackMovingEvent"); |