Merge pull request #8597 from SirMangler/master

Hotkeys: Toggle Freelook Hotkey
This commit is contained in:
Léo Lam
2020-03-15 22:40:51 +01:00
committed by GitHub
3 changed files with 11 additions and 2 deletions

View File

@ -528,6 +528,13 @@ void HotkeyScheduler::Run()
// Freelook
static float fl_speed = 1.0;
if (IsHotkey(HK_FREELOOK_TOGGLE))
{
const bool new_value = !Config::Get(Config::GFX_FREE_LOOK);
Config::SetCurrent(Config::GFX_FREE_LOOK, new_value);
OSD::AddMessage(StringFromFormat("Freelook: %s", new_value ? "Enabled" : "Disabled"));
}
if (IsHotkey(HK_FREELOOK_DECREASE_SPEED, true))
fl_speed /= 1.1f;