From 684e041568932a651aaeb09a1247f42860871a59 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jul 2014 13:14:09 +0300 Subject: move "change follow mode" 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 3d74169ee..ccf3bfe11 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -39,6 +39,7 @@ GameModifiers::GameModifiers() { settings.crazyMoveType = config.getIntValue("crazyMoveType"); settings.moveToTargetType = config.getIntValue("moveToTargetType"); + settings.followMode = config.getIntValue("followMode"); } GameModifiers::~GameModifiers() @@ -194,3 +195,31 @@ std::string GameModifiers::getMoveToTargetTypeString() return gettext(getVarItem(&moveToTargetTypeStrings[0], settings.moveToTargetType, moveToTargetTypeSize)); } + +static const unsigned followModeSize = 4; + +void GameModifiers::changeFollowMode(const bool forward) +{ + changeMode(&settings.followMode, followModeSize, "followMode", + &GameModifiers::getFollowModeString, 0, true, forward); +} + +static const char *const followModeStrings[] = +{ + // TRANSLATORS: folow mode in status bar + N_("(D) default follow"), + // TRANSLATORS: folow mode in status bar + N_("(R) relative follow"), + // TRANSLATORS: folow mode in status bar + N_("(M) mirror follow"), + // TRANSLATORS: folow mode in status bar + N_("(P) pet follow"), + // TRANSLATORS: folow mode in status bar + N_("(?) unknown follow") +}; + +std::string GameModifiers::getFollowModeString() +{ + return gettext(getVarItem(&followModeStrings[0], + settings.followMode, followModeSize)); +} -- cgit v1.2.3-60-g2f50