diff options
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r-- | src/gamemodifiers.cpp | 30 |
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)); +} |