Added pitch fly mode (#7817)
In pitch fly mode, you fly to the exact direction you are pointing at, using the forward key. Other move directions are also pitched accordingly. It allows smoother and more complex movements. Can be enabled/disabled by L key by default (set keymap_pitchfly in minetest.conf)
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user