diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-21 23:33:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-21 23:33:48 +0300 |
commit | 90bfc776dc4975c523c4c35fb0778cd9b77dc164 (patch) | |
tree | d7fdd90433077b20d847ee39de8a05d33509fcd3 /src/gamemodifiers.cpp | |
parent | c544a5ebb53d51fa98392188d2b44dc6ec27c390 (diff) | |
download | manaplus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.gz manaplus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.bz2 manaplus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.tar.xz manaplus-90bfc776dc4975c523c4c35fb0778cd9b77dc164.zip |
move "change pvp attack type" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r-- | src/gamemodifiers.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp index 87dcd5aa7..5ce9dd63b 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -45,6 +45,7 @@ GameModifiers::GameModifiers() settings.quickDropCounter = config.getIntValue("quickDropCounter"); settings.pickUpType = config.getIntValue("pickUpType"); settings.magicAttackType = config.getIntValue("magicAttackType"); + settings.pvpAttackType = config.getIntValue("pvpAttackType"); } GameModifiers::~GameModifiers() @@ -381,3 +382,31 @@ std::string GameModifiers::getMagicAttackString() return gettext(getVarItem(&magicAttackStrings[0], settings.magicAttackType, magicAttackSize)); } + +const unsigned pvpAttackTypeSize = 4; + +void GameModifiers::changePvpAttackType(const bool forward) +{ + changeMode(&settings.pvpAttackType, pvpAttackTypeSize, "pvpAttackType", + &GameModifiers::getPvpAttackTypeString, 0, true, forward); +} + +static const char *const pvpAttackTypeStrings[] = +{ + // TRANSLATORS: player attack type in status bar + N_("(a) attack all players"), + // TRANSLATORS: player attack type in status bar + N_("(f) attack all except friends"), + // TRANSLATORS: player attack type in status bar + N_("(b) attack bad relations"), + // TRANSLATORS: player attack type in status bar + N_("(d) don't attack players"), + // TRANSLATORS: player attack type in status bar + N_("(?) pvp attack") +}; + +std::string GameModifiers::getPvpAttackTypeString() +{ + return gettext(getVarItem(&pvpAttackTypeStrings[0], + settings.pvpAttackType, pvpAttackTypeSize)); +} |