From cfffcc941898c4163e1bd62b8e514d3535511666 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Jul 2014 13:00:00 +0300 Subject: move "change move to target type" option into gamemodifiers. --- src/gamemodifiers.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/gamemodifiers.cpp') diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp index 4facc4cf4..3d74169ee 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -38,6 +38,7 @@ GameModifiers *modifiers = nullptr; GameModifiers::GameModifiers() { settings.crazyMoveType = config.getIntValue("crazyMoveType"); + settings.moveToTargetType = config.getIntValue("moveToTargetType"); } GameModifiers::~GameModifiers() @@ -146,3 +147,50 @@ std::string GameModifiers::getCrazyMoveTypeString() return _("(?) crazy move"); } } + +static const unsigned moveToTargetTypeSize = 13; + +void GameModifiers::changeMoveToTargetType(const bool forward) +{ + changeMode(&settings.moveToTargetType, moveToTargetTypeSize, + "moveToTargetType", + &GameModifiers::getMoveToTargetTypeString, 0, true, forward); +} + +static const char *const moveToTargetTypeStrings[] = +{ + // TRANSLATORS: move to target type in status bar + N_("(0) default moves to target"), + // TRANSLATORS: move to target type in status bar + N_("(1) moves to target in distance 1"), + // TRANSLATORS: move to target type in status bar + N_("(2) moves to target in distance 2"), + // TRANSLATORS: move to target type in status bar + N_("(3) moves to target in distance 3"), + // TRANSLATORS: move to target type in status bar + N_("(4) moves to target in distance 4"), + // TRANSLATORS: move to target type in status bar + N_("(5) moves to target in distance 5"), + // TRANSLATORS: move to target type in status bar + N_("(6) moves to target in distance 6"), + // TRANSLATORS: move to target type in status bar + N_("(7) moves to target in distance 7"), + // TRANSLATORS: move to target type in status bar + N_("(8) moves to target in distance 8"), + // TRANSLATORS: move to target type in status bar + N_("(9) moves to target in distance 9"), + // TRANSLATORS: move to target type in status bar + N_("(A) moves to target in attack range"), + // TRANSLATORS: move to target type in status bar + N_("(a) archer attack range"), + // TRANSLATORS: move to target type in status bar + N_("(B) moves to target in attack range - 1"), + // TRANSLATORS: move to target type in status bar + N_("(?) move to target") +}; + +std::string GameModifiers::getMoveToTargetTypeString() +{ + return gettext(getVarItem(&moveToTargetTypeStrings[0], + settings.moveToTargetType, moveToTargetTypeSize)); +} -- cgit v1.2.3-70-g09d2