From 8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jul 2014 17:53:41 +0300 Subject: move "change attack type" option into gamemodifiers. --- src/gamemodifiers.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/gamemodifiers.cpp') diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp index e04629301..6fa606408 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -41,6 +41,7 @@ GameModifiers::GameModifiers() settings.moveToTargetType = config.getIntValue("moveToTargetType"); settings.followMode = config.getIntValue("followMode"); settings.attackWeaponType = config.getIntValue("attackWeaponType"); + settings.attackType = config.getIntValue("attackType"); } GameModifiers::~GameModifiers() @@ -253,3 +254,31 @@ std::string GameModifiers::getAttackWeaponTypeString() return gettext(getVarItem(&attackWeaponTypeStrings[0], settings.attackWeaponType, attackWeaponTypeSize)); } + +const unsigned attackTypeSize = 4; + +void GameModifiers::changeAttackType(const bool forward) +{ + changeMode(&settings.attackType, attackTypeSize, "attackType", + &GameModifiers::getAttackTypeString, 0, true, forward); +} + +static const char *const attackTypeStrings[] = +{ + // TRANSLATORS: attack type in status bar + N_("(D) default attack"), + // TRANSLATORS: attack type in status bar + N_("(G) go and attack"), + // TRANSLATORS: attack type in status bar + N_("(A) go, attack, pickup"), + // TRANSLATORS: attack type in status bar + N_("(d) without auto attack"), + // TRANSLATORS: attack type in status bar + N_("(?) attack") +}; + +std::string GameModifiers::getAttackTypeString() +{ + return gettext(getVarItem(&attackTypeStrings[0], + settings.attackType, attackTypeSize)); +} -- cgit v1.2.3-70-g09d2