summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-19 22:02:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-20 00:26:53 +0300
commite3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91 (patch)
tree2959d64c52fb2d9df7ca30fb5a400e17570c4861 /src/gamemodifiers.cpp
parentac9d9925b52789abc07795d5ed52dd0de620c757 (diff)
downloadmanaplus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.gz
manaplus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.bz2
manaplus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.xz
manaplus-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.zip
Add quick settings page for yellow bar options.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index a77861370..97e4df286 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -37,6 +37,8 @@
#include "gui/widgets/tabs/chat/chattab.h"
+#include "listeners/gamemodifierlistener.h"
+
#include "resources/map/map.h"
#include "listeners/awaylistener.h"
@@ -125,6 +127,7 @@ void GameModifiers::changeMode(unsigned *restrict const var,
if (save)
config.setValue(conf, *var);
UpdateStatusListener::distributeEvent();
+ GameModifierListener::distributeEvent();
const std::string str = (*func)();
if (str.size() > 4)
debugMsg(str.substr(4));
@@ -291,6 +294,7 @@ void GameModifiers::setQuickDropCounter(const int n)
settings.quickDropCounter = n;
config.setValue("quickDropCounter", n);
UpdateStatusListener::distributeEvent();
+ GameModifierListener::distributeEvent();
}
addModifier2(PickUpType, pickUpType, "pickUpType", 7,
@@ -363,11 +367,12 @@ addModifier(GameModifiers, disableGameModifiers, 2,
N_("Game modifiers are unknown")
})
-void GameModifiers::changeGameModifiers()
+void GameModifiers::changeGameModifiers(const bool forward A_UNUSED)
{
settings.disableGameModifiers = !settings.disableGameModifiers;
config.setValue("disableGameModifiers", settings.disableGameModifiers);
UpdateStatusListener::distributeEvent();
+ GameModifierListener::distributeEvent();
}
addModifier(MapDrawType, mapDrawType, 7,
@@ -390,6 +395,12 @@ addModifier(MapDrawType, mapDrawType, 7,
N_("(?) map view")
})
+void GameModifiers::changeMapDrawType(const bool forward A_UNUSED)
+{
+ if (viewport)
+ viewport->toggleMapDrawType();
+}
+
addModifier(AwayMode, awayMode, 2,
{
// TRANSLATORS: away type in status bar
@@ -400,7 +411,7 @@ addModifier(AwayMode, awayMode, 2,
N_("(?) away")
})
-void GameModifiers::changeAwayMode()
+void GameModifiers::changeAwayMode(const bool forward A_UNUSED)
{
if (!localPlayer)
return;
@@ -411,6 +422,7 @@ void GameModifiers::changeAwayMode()
localPlayer->updateName();
Game::instance()->updateFrameRate(0);
UpdateStatusListener::distributeEvent();
+ GameModifierListener::distributeEvent();
if (settings.awayMode)
{
if (chatWindow)
@@ -454,6 +466,13 @@ addModifier(CameraMode, cameraMode, 2,
N_("(?) away")
})
+
+void GameModifiers::changeCameraMode(const bool forward A_UNUSED)
+{
+ if (viewport)
+ viewport->toggleCameraMode();
+}
+
void GameModifiers::resetModifiers()
{
settings.moveType = 0;
@@ -480,4 +499,5 @@ void GameModifiers::resetModifiers()
"disableGameModifiers");
UpdateStatusListener::distributeEvent();
+ GameModifierListener::distributeEvent();
}