summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-22 01:41:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-22 01:41:19 +0300
commitd569dc78b5b50c0e6cbe84e48164e5774fd36de7 (patch)
treeabe4bf6e0822fe0d1ee2149f88cd0e6e4452c396 /src/gamemodifiers.cpp
parentaaa50f7ef8de21ea1f32065beb15a7a58faf28a5 (diff)
downloadmanaverse-d569dc78b5b50c0e6cbe84e48164e5774fd36de7.tar.gz
manaverse-d569dc78b5b50c0e6cbe84e48164e5774fd36de7.tar.bz2
manaverse-d569dc78b5b50c0e6cbe84e48164e5774fd36de7.tar.xz
manaverse-d569dc78b5b50c0e6cbe84e48164e5774fd36de7.zip
move "change game modifiers" option into gamemodifiers.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index bb1907a37..777d7e9f0 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -47,6 +47,8 @@ GameModifiers::GameModifiers()
settings.magicAttackType = config.getIntValue("magicAttackType");
settings.pvpAttackType = config.getIntValue("pvpAttackType");
settings.imitationMode = config.getIntValue("imitationMode");
+ settings.disableGameModifiers = config.getBoolValue(
+ "disableGameModifiers");
}
GameModifiers::~GameModifiers()
@@ -435,3 +437,28 @@ std::string GameModifiers::getImitationModeString()
return gettext(getVarItem(&imitationModeStrings[0],
settings.imitationMode, imitationModeSize));
}
+
+const unsigned gameModifiersSize = 2;
+
+void GameModifiers::changeGameModifiers()
+{
+ settings.disableGameModifiers = !settings.disableGameModifiers;
+ config.setValue("disableGameModifiers", settings.disableGameModifiers);
+ UpdateStatusListener::distributeEvent();
+}
+
+static const char *const gameModifiersStrings[] =
+{
+ // TRANSLATORS: game modifiers state in status bar
+ N_("Game modifiers are enabled"),
+ // TRANSLATORS: game modifiers state in status bar
+ N_("Game modifiers are disabled"),
+ // TRANSLATORS: game modifiers state in status bar
+ N_("Game modifiers are unknown")
+};
+
+std::string GameModifiers::getGameModifiersString()
+{
+ return gettext(getVarItem(&gameModifiersStrings[0],
+ settings.disableGameModifiers, gameModifiersSize));
+}