Skip to content

Commit

Permalink
Merge pull request dolphin-emu#8597 from SirMangler/master
Browse files Browse the repository at this point in the history
Hotkeys: Toggle Freelook Hotkey
  • Loading branch information
leoetlino authored Mar 15, 2020
2 parents d9eec2e + ac34911 commit a66ee4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Core/Core/HotkeyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/HotkeyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions Source/Core/DolphinQt/HotkeyScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a66ee4e

Please sign in to comment.