summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 13:14:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 13:14:09 +0300
commit684e041568932a651aaeb09a1247f42860871a59 (patch)
treec1398692d694b01150b204a19199776b06a919a5 /src/gamemodifiers.cpp
parentcfffcc941898c4163e1bd62b8e514d3535511666 (diff)
downloadmanaplus-684e041568932a651aaeb09a1247f42860871a59.tar.gz
manaplus-684e041568932a651aaeb09a1247f42860871a59.tar.bz2
manaplus-684e041568932a651aaeb09a1247f42860871a59.tar.xz
manaplus-684e041568932a651aaeb09a1247f42860871a59.zip
move "change follow mode" 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 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));
+}