summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-21 00:18:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-21 00:18:41 +0300
commitb02b4ce0b656a93fbcaa927b0ba289edfec6e22c (patch)
treea31a6f99778d0cf0b45689584939bd8c391627ae /src/gamemodifiers.cpp
parent744b9d6689b67779a1d17c6d3de7cd016ca1033b (diff)
downloadplus-b02b4ce0b656a93fbcaa927b0ba289edfec6e22c.tar.gz
plus-b02b4ce0b656a93fbcaa927b0ba289edfec6e22c.tar.bz2
plus-b02b4ce0b656a93fbcaa927b0ba289edfec6e22c.tar.xz
plus-b02b4ce0b656a93fbcaa927b0ba289edfec6e22c.zip
move "change crazy move" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index aea2fa6d6..4facc4cf4 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -37,6 +37,7 @@ GameModifiers *modifiers = nullptr;
GameModifiers::GameModifiers()
{
+ settings.crazyMoveType = config.getIntValue("crazyMoveType");
}
GameModifiers::~GameModifiers()
@@ -115,3 +116,33 @@ std::string GameModifiers::getMoveTypeString()
return gettext(getVarItem(&moveTypeStrings[0],
settings.moveType, moveTypeSize));
}
+
+static const unsigned crazyMoveTypeSize = 11;
+
+void GameModifiers::changeCrazyMoveType(const bool forward)
+{
+ player_node->setCrazyMoveState(0U);
+ changeMode(&settings.crazyMoveType, crazyMoveTypeSize, "crazyMoveType",
+ &GameModifiers::getCrazyMoveTypeString, 1, true, forward);
+}
+
+std::string GameModifiers::getCrazyMoveTypeString()
+{
+ const unsigned int crazyMoveType = settings.crazyMoveType;
+ if (crazyMoveType < crazyMoveTypeSize - 1)
+ {
+ // TRANSLATORS: crazy move type in status bar
+ return strprintf(_("(%u) crazy move number %u"),
+ crazyMoveType, crazyMoveType);
+ }
+ else if (crazyMoveType == crazyMoveTypeSize - 1)
+ {
+ // TRANSLATORS: crazy move type in status bar
+ return _("(a) custom crazy move");
+ }
+ else
+ {
+ // TRANSLATORS: crazy move type in status bar
+ return _("(?) crazy move");
+ }
+}