summaryrefslogtreecommitdiff
path: root/src/being/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 21:39:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 21:39:00 +0300
commiteed7ef561a9d590d507255118132676f868b1bd3 (patch)
tree586f7f394c0d7678ed615525c6129fb9d787bf04 /src/being/localplayer.cpp
parentc41fcc1f637e76e5ff671b223ce6c151af89e7d3 (diff)
downloadplus-eed7ef561a9d590d507255118132676f868b1bd3.tar.gz
plus-eed7ef561a9d590d507255118132676f868b1bd3.tar.bz2
plus-eed7ef561a9d590d507255118132676f868b1bd3.tar.xz
plus-eed7ef561a9d590d507255118132676f868b1bd3.zip
move "change pickup type" option into gamemodifiers.
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r--src/being/localplayer.cpp44
1 files changed, 5 insertions, 39 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);