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

@ -22,7 +22,7 @@
#include "InputCommon/GCPadStatus.h"
// clang-format off
constexpr std::array<const char*, 133> s_hotkey_labels{{
constexpr std::array<const char*, 134> s_hotkey_labels{{
_trans("Open"),
_trans("Change Disc"),
_trans("Eject Disc"),
@ -124,6 +124,7 @@ constexpr std::array<const char*, 133> s_hotkey_labels{{
_trans("Freelook Zoom In"),
_trans("Freelook Zoom Out"),
_trans("Freelook Reset"),
_trans("Freelook Toggle"),
_trans("Toggle 3D Side-by-Side"),
_trans("Toggle 3D Top-Bottom"),
@ -290,7 +291,7 @@ constexpr std::array<HotkeyGroupInfo, NUM_HOTKEY_GROUPS> s_groups_info = {
{_trans("Controller Profile"), HK_NEXT_WIIMOTE_PROFILE_1, HK_PREV_GAME_WIIMOTE_PROFILE_4},
{_trans("Graphics Toggles"), HK_TOGGLE_CROP, HK_TOGGLE_TEXTURES},
{_trans("Internal Resolution"), HK_INCREASE_IR, HK_DECREASE_IR},
{_trans("Freelook"), HK_FREELOOK_DECREASE_SPEED, HK_FREELOOK_RESET},
{_trans("Freelook"), HK_FREELOOK_DECREASE_SPEED, HK_FREELOOK_TOGGLE},
// i18n: Stereoscopic 3D
{_trans("3D"), HK_TOGGLE_STEREO_SBS, HK_TOGGLE_STEREO_ANAGLYPH},
// i18n: Stereoscopic 3D

View File

@ -110,6 +110,7 @@ enum Hotkey
HK_FREELOOK_ZOOM_IN,
HK_FREELOOK_ZOOM_OUT,
HK_FREELOOK_RESET,
HK_FREELOOK_TOGGLE,
HK_TOGGLE_STEREO_SBS,
HK_TOGGLE_STEREO_TAB,

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;