diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-05 21:55:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-05 21:55:20 +0300 |
commit | 5413a9e7c761dc80cf33dbee8593b8721c1539b6 (patch) | |
tree | 3fd9b01c8d4d3d75b02b4fec531927b282b7df29 | |
parent | ac01c186d37b14da92314ff44b4e043b0c0ee31b (diff) | |
download | manaplus-5413a9e7c761dc80cf33dbee8593b8721c1539b6.tar.gz manaplus-5413a9e7c761dc80cf33dbee8593b8721c1539b6.tar.bz2 manaplus-5413a9e7c761dc80cf33dbee8593b8721c1539b6.tar.xz manaplus-5413a9e7c761dc80cf33dbee8593b8721c1539b6.zip |
add option to use special diagonal moving speed.
By default option enabled.
-rw-r--r-- | src/being/being.cpp | 4 | ||||
-rw-r--r-- | src/being/being.h | 1 | ||||
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/gui/setup_players.cpp | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 73652bb1a..d773e68ca 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -89,6 +89,7 @@ bool Being::mShowPlayersStatus = false; bool Being::mEnableReorderSprites = true; bool Being::mHideErased = false; bool Being::mMoveNames = false; +bool Being::mUseDiagonal = true; int Being::mAwayEffect = -1; std::list<BeingCacheEntry*> beingInfoCache; @@ -1347,7 +1348,7 @@ void Being::nextTile() } mActionTime += static_cast<int>(mSpeed / 10); - if (mX != pos.x && mY != pos.y) + if ((mType != PLAYER || mUseDiagonal) && mX != pos.x && mY != pos.y) mSpeed = mWalkSpeed.x * 1.4; else mSpeed = mWalkSpeed.x; @@ -2034,6 +2035,7 @@ void Being::reReadConfig() mEnableReorderSprites = config.getBoolValue("enableReorderSprites"); mHideErased = config.getBoolValue("hideErased"); mMoveNames = config.getBoolValue("moveNames"); + mUseDiagonal = config.getBoolValue("useDiagonalSpeed"); mUpdateConfigTime = cur_time; } diff --git a/src/being/being.h b/src/being/being.h index e373ec5e3..7033f3981 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -1034,6 +1034,7 @@ class Being : public ActorSprite, public ConfigListener static bool mEnableReorderSprites; static bool mHideErased; static bool mMoveNames; + static bool mUseDiagonal; static int mAwayEffect; unsigned int mMoveTime; diff --git a/src/defaults.cpp b/src/defaults.cpp index 23d8995a5..06e67d6ed 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -322,6 +322,7 @@ DefaultsData* getConfigDefaults() AddDEF("cfgver", 0); AddDEF("enableDebugLog", false); AddDEF("doubleClick", true); + AddDEF("useDiagonalSpeed", true); return configData; } diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index bd2b829fd..c7c5e04cb 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -108,5 +108,9 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : new SetupItemCheckBox(_("Hide erased players nicks"), "", "hideErased", this, "hideErasedEvent"); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Use special diagonal speed in players moving"), "", + "useDiagonalSpeed", this, "useDiagonalSpeedEvent"); + setDimension(gcn::Rectangle(0, 0, 550, 350)); } |