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
commit a66ee4ea42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;