diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-21 21:39:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-21 21:39:00 +0300 |
commit | eed7ef561a9d590d507255118132676f868b1bd3 (patch) | |
tree | 586f7f394c0d7678ed615525c6129fb9d787bf04 /src/being | |
parent | c41fcc1f637e76e5ff671b223ce6c151af89e7d3 (diff) | |
download | mv-eed7ef561a9d590d507255118132676f868b1bd3.tar.gz mv-eed7ef561a9d590d507255118132676f868b1bd3.tar.bz2 mv-eed7ef561a9d590d507255118132676f868b1bd3.tar.xz mv-eed7ef561a9d590d507255118132676f868b1bd3.zip |
move "change pickup type" option into gamemodifiers.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 44 | ||||
-rw-r--r-- | src/being/localplayer.h | 9 |
2 files changed, 5 insertions, 48 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 3e6051643..035697a73 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -115,7 +115,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) : mGMLevel(0), mCrazyMoveState(0), mMoveState(0), - mPickUpType(config.getIntValue("pickUpType")), mMagicAttackType(config.getIntValue("magicAttackType")), mPvpAttackType(config.getIntValue("pvpAttackType")), mImitationMode(config.getIntValue("imitationMode")), @@ -478,7 +477,8 @@ bool LocalPlayer::pickUp(FloorItem *const item) const int dy = item->getTileY() - mY; int dist = 6; - if (mPickUpType >= 4 && mPickUpType <= 6) + const unsigned int pickUpType = settings.pickUpType; + if (pickUpType >= 4 && pickUpType <= 6) dist = 4; if (dx * dx + dy * dy < dist) @@ -489,7 +489,7 @@ bool LocalPlayer::pickUp(FloorItem *const item) mPickUpTarget = nullptr; } } - else if (mPickUpType >= 4 && mPickUpType <= 6) + else if (pickUpType >= 4 && pickUpType <= 6) { const Vector &playerPos = getPosition(); const Path debugPath = mMap->findPath( @@ -1259,40 +1259,6 @@ void LocalPlayer::changeMode(unsigned *restrict const var, debugMsg(str.substr(4)); } -const unsigned pickUpTypeSize = 7; - -void LocalPlayer::changePickUpType(const bool forward) -{ - changeMode(&mPickUpType, pickUpTypeSize, "pickUpType", - &LocalPlayer::getPickUpTypeString, 0, true, forward); -} - -static const char *const pickUpTypeStrings[] = -{ - // TRANSLATORS: pickup size in status bar - N_("(S) small pick up 1x1 cells"), - // TRANSLATORS: pickup size in status bar - N_("(D) default pick up 2x1 cells"), - // TRANSLATORS: pickup size in status bar - N_("(F) forward pick up 2x3 cells"), - // TRANSLATORS: pickup size in status bar - N_("(3) pick up 3x3 cells"), - // TRANSLATORS: pickup size in status bar - N_("(g) go and pick up in distance 4"), - // TRANSLATORS: pickup size in status bar - N_("(G) go and pick up in distance 8"), - // TRANSLATORS: pickup size in status bar - N_("(A) go and pick up in max distance"), - // TRANSLATORS: pickup size in status bar - N_("(?) pick up") -}; - -std::string LocalPlayer::getPickUpTypeString() -{ - return gettext(getVarItem(&pickUpTypeStrings[0], - mPickUpType, pickUpTypeSize)); -} - const unsigned debugPathSize = 7; static const char *const debugPathStrings[] = @@ -2334,7 +2300,7 @@ bool LocalPlayer::pickUpItems(int pickUpType) status = pickUp(item); if (pickUpType == 0) - pickUpType = mPickUpType; + pickUpType = settings.pickUpType; if (pickUpType == 0) return status; @@ -3500,7 +3466,7 @@ void LocalPlayer::resetYellowBar() mMagicAttackType = config.resetIntValue("magicAttackType"); mPvpAttackType = config.resetIntValue("pvpAttackType"); settings.quickDropCounter = config.resetIntValue("quickDropCounter"); - mPickUpType = config.resetIntValue("pickUpType"); + settings.pickUpType = config.resetIntValue("pickUpType"); if (viewport) { viewport->setMapDrawType(0); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 8660efd87..835e85dbe 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -191,11 +191,6 @@ class LocalPlayer final : public Being, void changeImitationMode(const bool forward); - void changePickUpType(const bool forward); - - int getPickUpType() const A_WARN_UNUSED - { return mPickUpType; } - unsigned int getMoveState() const A_WARN_UNUSED { return mMoveState; } @@ -417,8 +412,6 @@ class LocalPlayer final : public Being, void setTestParticle(const std::string &fileName, const bool updateHash = true); - std::string getPickUpTypeString(); - static std::string getMapDrawTypeString(); std::string getMagicAttackString(); @@ -493,8 +486,6 @@ class LocalPlayer final : public Being, unsigned int mCrazyMoveState; // move state. used if mMoveType == 2 unsigned int mMoveState; - // pick up type 1x1, normal aka 2x1, forward aka 2x3, 3x3, 3x3 + 1 - unsigned int mPickUpType; // magic attack type unsigned int mMagicAttackType; // pvp attack type |