summaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 6cf6723e9..418b412fa 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -701,6 +701,7 @@ protected:
void openConsole(float scale, const wchar_t *line=NULL);
void toggleFreeMove();
void toggleFreeMoveAlt();
+ void togglePitchFly();
void toggleFast();
void toggleNoClip();
void toggleCinematic();
@@ -1896,6 +1897,8 @@ void Game::processKeyInput()
toggleFreeMove();
} else if (wasKeyDown(KeyType::JUMP)) {
toggleFreeMoveAlt();
+ } else if (wasKeyDown(KeyType::PITCHFLY)) {
+ togglePitchFly();
} else if (wasKeyDown(KeyType::FASTMOVE)) {
toggleFast();
} else if (wasKeyDown(KeyType::NOCLIP)) {
@@ -2107,6 +2110,19 @@ void Game::toggleFreeMoveAlt()
}
+void Game::togglePitchFly()
+{
+ bool pitch_fly = !g_settings->getBool("pitch_fly");
+ g_settings->set("pitch_fly", bool_to_cstr(pitch_fly));
+
+ if (pitch_fly) {
+ m_game_ui->showTranslatedStatusText("Pitch fly mode enabled");
+ } else {
+ m_game_ui->showTranslatedStatusText("Pitch fly mode disabled");
+ }
+}
+
+
void Game::toggleFast()
{
bool fast_move = !g_settings->getBool("fast_move");