diff options
author | ThomasMonroe314 <ThomasMonroe@protonmail.com> | 2018-01-29 11:21:49 -0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2018-02-08 15:40:16 +0100 |
commit | 501f936b37046ab469844c5349054369de3e7fc6 (patch) | |
tree | 406b5a010d23263b12bd7e2b1d390f3b22b5118c | |
parent | e87b410a33639bffe69725ed3ea5d85e45280815 (diff) | |
download | minetest-501f936b37046ab469844c5349054369de3e7fc6.tar.gz minetest-501f936b37046ab469844c5349054369de3e7fc6.tar.bz2 minetest-501f936b37046ab469844c5349054369de3e7fc6.zip |
Switch F3 to use 'enable_fog' setting
-rw-r--r-- | src/client/inputhandler.cpp | 2 | ||||
-rw-r--r-- | src/client/keys.h | 2 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 2 | ||||
-rw-r--r-- | src/game.cpp | 12 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp index 95d9fef71..e465c018a 100644 --- a/src/client/inputhandler.cpp +++ b/src/client/inputhandler.cpp @@ -58,7 +58,7 @@ void KeyCache::populate() key[KeyType::SCREENSHOT] = getKeySetting("keymap_screenshot"); key[KeyType::TOGGLE_HUD] = getKeySetting("keymap_toggle_hud"); key[KeyType::TOGGLE_CHAT] = getKeySetting("keymap_toggle_chat"); - key[KeyType::TOGGLE_FORCE_FOG_OFF] = getKeySetting("keymap_toggle_force_fog_off"); + key[KeyType::TOGGLE_FOG] = getKeySetting("keymap_toggle_fog"); key[KeyType::TOGGLE_UPDATE_CAMERA] = getKeySetting("keymap_toggle_update_camera"); key[KeyType::TOGGLE_DEBUG] = getKeySetting("keymap_toggle_debug"); key[KeyType::TOGGLE_PROFILER] = getKeySetting("keymap_toggle_profiler"); diff --git a/src/client/keys.h b/src/client/keys.h index 9b8e50358..e7ef5f456 100644 --- a/src/client/keys.h +++ b/src/client/keys.h @@ -58,7 +58,7 @@ public: SCREENSHOT, TOGGLE_HUD, TOGGLE_CHAT, - TOGGLE_FORCE_FOG_OFF, + TOGGLE_FOG, TOGGLE_UPDATE_CAMERA, TOGGLE_DEBUG, TOGGLE_PROFILER, diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index f6a28633b..0d1b3aa86 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -90,7 +90,7 @@ void set_default_settings(Settings *settings) settings->setDefault("keymap_cinematic", ""); settings->setDefault("keymap_toggle_hud", "KEY_F1"); settings->setDefault("keymap_toggle_chat", "KEY_F2"); - settings->setDefault("keymap_toggle_force_fog_off", "KEY_F3"); + settings->setDefault("keymap_toggle_fog", "KEY_F3"); #if DEBUG settings->setDefault("keymap_toggle_update_camera", "KEY_F4"); #else diff --git a/src/game.cpp b/src/game.cpp index 416b097fb..598be12d6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1915,7 +1915,7 @@ void Game::processKeyInput() toggleMinimap(isKeyDown(KeyType::SNEAK)); } else if (wasKeyDown(KeyType::TOGGLE_CHAT)) { m_game_ui->toggleChat(); - } else if (wasKeyDown(KeyType::TOGGLE_FORCE_FOG_OFF)) { + } else if (wasKeyDown(KeyType::TOGGLE_FOG)) { toggleFog(); } else if (wasKeyDown(KeyType::TOGGLE_UPDATE_CAMERA)) { toggleUpdateCamera(); @@ -2204,8 +2204,9 @@ void Game::toggleMinimap(bool shift_pressed) void Game::toggleFog() { - m_flags.force_fog_off = !m_flags.force_fog_off; - if (m_flags.force_fog_off) + bool fog_enabled = g_settings->getBool("enable_fog"); + g_settings->setBool("enable_fog", !fog_enabled); + if (fog_enabled) m_game_ui->showTranslatedStatusText("Fog disabled"); else m_game_ui->showTranslatedStatusText("Fog enabled"); @@ -3672,8 +3673,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, camera_node_position.Z = camera_node_position.Z + camera_offset.Z * BS; clouds->update(camera_node_position, sky->getCloudColor()); - if (clouds->isCameraInsideCloud() && m_cache_enable_fog && - !m_flags.force_fog_off) { + if (clouds->isCameraInsideCloud() && m_cache_enable_fog) { // if inside clouds, and fog enabled, use that as sky // color(s) video::SColor clouds_dark = clouds->getColor() @@ -3698,7 +3698,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, Fog */ - if (m_cache_enable_fog && !m_flags.force_fog_off) { + if (m_cache_enable_fog) { driver->setFog( sky->getBgColor(), video::EFT_FOG_LINEAR, |