summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 13:24:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 13:24:00 +0300
commit623c0127e4ad5170e9ee003475ed566cec55cfeb (patch)
tree269181626445874223a4b450ea65d6dbc46fb3c3 /src/gamemodifiers.cpp
parent684e041568932a651aaeb09a1247f42860871a59 (diff)
downloadmv-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.gz
mv-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.bz2
mv-623c0127e4ad5170e9ee003475ed566cec55cfeb.tar.xz
mv-623c0127e4ad5170e9ee003475ed566cec55cfeb.zip
move "change attack weapon type" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index ccf3bfe11..e04629301 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -40,6 +40,7 @@ GameModifiers::GameModifiers()
settings.crazyMoveType = config.getIntValue("crazyMoveType");
settings.moveToTargetType = config.getIntValue("moveToTargetType");
settings.followMode = config.getIntValue("followMode");
+ settings.attackWeaponType = config.getIntValue("attackWeaponType");
}
GameModifiers::~GameModifiers()
@@ -223,3 +224,32 @@ std::string GameModifiers::getFollowModeString()
return gettext(getVarItem(&followModeStrings[0],
settings.followMode, followModeSize));
}
+
+const unsigned attackWeaponTypeSize = 4;
+
+void GameModifiers::changeAttackWeaponType(const bool forward)
+{
+ changeMode(&settings.attackWeaponType, attackWeaponTypeSize,
+ "attackWeaponType",
+ &GameModifiers::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 GameModifiers::getAttackWeaponTypeString()
+{
+ return gettext(getVarItem(&attackWeaponTypeStrings[0],
+ settings.attackWeaponType, attackWeaponTypeSize));
+}