summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 17:53:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 17:53:41 +0300
commit8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1 (patch)
tree61f95032eb06210d145b3f1f704c2f60a396974a /src/gamemodifiers.cpp
parent623c0127e4ad5170e9ee003475ed566cec55cfeb (diff)
downloadplus-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.gz
plus-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.bz2
plus-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.tar.xz
plus-8b6afd0d756b9fc66c9f4de3ef452c24f64c87d1.zip
move "change attack type" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp29
1 files changed, 29 insertions, 0 deletions
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));
+}