From 623c0127e4ad5170e9ee003475ed566cec55cfeb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jul 2014 13:24:00 +0300 Subject: move "change attack weapon type" option into gamemodifiers. --- src/gamemodifiers.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/gamemodifiers.cpp') 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)); +} -- cgit v1.2.3-60-g2f50