diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-21 13:24:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-21 13:24:00 +0300 |
commit | 623c0127e4ad5170e9ee003475ed566cec55cfeb (patch) | |
tree | 269181626445874223a4b450ea65d6dbc46fb3c3 /src/being | |
parent | 684e041568932a651aaeb09a1247f42860871a59 (diff) | |
download | plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.gz plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.bz2 plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.xz plus-623c0127e4ad5170e9ee003475ed566cec55cfeb.zip |
move "change attack weapon type" option into gamemodifiers.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 35 | ||||
-rw-r--r-- | src/being/localplayer.h | 9 |
2 files changed, 3 insertions, 41 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 63834f934..aed4a17e2 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -114,7 +114,6 @@ LocalPlayer::LocalPlayer(const int id, const uint16_t subtype) : StatListener(), mGMLevel(0), mCrazyMoveState(0), - mAttackWeaponType(config.getIntValue("attackWeaponType")), mQuickDropCounter(config.getIntValue("quickDropCounter")), mMoveState(0), mPickUpType(config.getIntValue("pickUpType")), @@ -1262,34 +1261,6 @@ void LocalPlayer::changeMode(unsigned *restrict const var, debugMsg(str.substr(4)); } -const unsigned attackWeaponTypeSize = 4; - -void LocalPlayer::changeAttackWeaponType(const bool forward) -{ - changeMode(&mAttackWeaponType, attackWeaponTypeSize, "attackWeaponType", - &LocalPlayer::getAttackWeaponTypeString, 1, true, forward); -} - -static const char *const attackWeaponTypeStrings[] = -{ - // TRANSLATORS: switch attack type in status bar - N_("(?) attack"), - // TRANSLATORS: switch attack type in status bar - N_("(D) default attack"), - // TRANSLATORS: switch attack type in status bar - N_("(s) switch attack without shield"), - // TRANSLATORS: switch attack type in status bar - N_("(S) switch attack with shield"), - // TRANSLATORS: switch attack type in status bar - N_("(?) attack") -}; - -std::string LocalPlayer::getAttackWeaponTypeString() -{ - return gettext(getVarItem(&attackWeaponTypeStrings[0], - mAttackWeaponType, attackWeaponTypeSize)); -} - const unsigned attackTypeSize = 4; void LocalPlayer::changeAttackType(const bool forward) @@ -1598,7 +1569,7 @@ std::string LocalPlayer::getGameModifiersString() void LocalPlayer::changeEquipmentBeforeAttack(const Being *const target) const { - if (mAttackWeaponType == 1 || !target || !PlayerInfo::getInventory()) + if (settings.attackWeaponType == 1 || !target || !PlayerInfo::getInventory()) return; bool allowSword = false; @@ -1637,7 +1608,7 @@ void LocalPlayer::changeEquipmentBeforeAttack(const Being *const target) const PlayerInfo::equipItem(item, true); // if need equip shield too - if (mAttackWeaponType == 3) + if (settings.attackWeaponType == 3) { // searching shield const WeaponsInfos &shields = WeaponsDB::getShields(); @@ -3585,7 +3556,7 @@ void LocalPlayer::resetYellowBar() settings.crazyMoveType = config.resetIntValue("crazyMoveType"); settings.moveToTargetType = config.resetIntValue("moveToTargetType"); settings.followMode = config.resetIntValue("followMode"); - mAttackWeaponType = config.resetIntValue("attackWeaponType"); + settings.attackWeaponType = config.resetIntValue("attackWeaponType"); mAttackType = config.resetIntValue("attackType"); mMagicAttackType = config.resetIntValue("magicAttackType"); mPvpAttackType = config.resetIntValue("pvpAttackType"); diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 76fe055da..711582125 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -186,17 +186,12 @@ class LocalPlayer final : public Being, bool isPathSetByMouse() const A_WARN_UNUSED { return mPathSetByMouse; } - int getAttackWeaponType() const A_WARN_UNUSED - { return mAttackWeaponType; } - int getAttackType() const A_WARN_UNUSED { return mAttackType; } int getImitationMode() const A_WARN_UNUSED { return mImitationMode; } - void changeAttackWeaponType(const bool forward); - void changeAttackType(const bool forward); void changeImitationMode(const bool forward); @@ -434,8 +429,6 @@ class LocalPlayer final : public Being, void setTestParticle(const std::string &fileName, const bool updateHash = true); - std::string getAttackWeaponTypeString(); - std::string getAttackTypeString(); std::string getQuickDropCounterString(); @@ -514,8 +507,6 @@ class LocalPlayer final : public Being, // crazy move state unsigned int mCrazyMoveState; - // attack weapon type - unsigned int mAttackWeaponType; // quick drop counter unsigned int mQuickDropCounter; // move state. used if mMoveType == 2 |