| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,247 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #include "Core/FreeLookManager.h" | ||
|
|
||
| #include "Common/Common.h" | ||
| #include "Common/CommonTypes.h" | ||
| #include "Common/Config/Config.h" | ||
|
|
||
| #include "Core/ConfigManager.h" | ||
| #include "Core/FreeLookConfig.h" | ||
|
|
||
| #include "InputCommon/ControllerEmu/ControlGroup/Buttons.h" | ||
| #include "InputCommon/InputConfig.h" | ||
|
|
||
| #include "VideoCommon/FreeLookCamera.h" | ||
| #include "VideoCommon/OnScreenDisplay.h" | ||
|
|
||
| namespace | ||
| { | ||
| namespace MoveButtons | ||
| { | ||
| enum MoveButtons | ||
| { | ||
| Up, | ||
| Down, | ||
| Left, | ||
| Right, | ||
| Forward, | ||
| Backward, | ||
| }; | ||
| } | ||
|
|
||
| namespace SpeedButtons | ||
| { | ||
| enum SpeedButtons | ||
| { | ||
| Decrease, | ||
| Increase, | ||
| Reset, | ||
| }; | ||
| } | ||
|
|
||
| namespace OtherButtons | ||
| { | ||
| enum OtherButtons | ||
| { | ||
| ResetView, | ||
| }; | ||
| } | ||
|
|
||
| namespace FieldOfViewButtons | ||
| { | ||
| enum FieldOfViewButtons | ||
| { | ||
| IncreaseX, | ||
| DecreaseX, | ||
| IncreaseY, | ||
| DecreaseY, | ||
| }; | ||
| } | ||
| } // namespace | ||
|
|
||
| FreeLookController::FreeLookController(const unsigned int index) : m_index(index) | ||
| { | ||
| groups.emplace_back(m_move_buttons = new ControllerEmu::Buttons(_trans("Move"))); | ||
|
|
||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Up")); | ||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Down")); | ||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Left")); | ||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Right")); | ||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Forward")); | ||
| m_move_buttons->AddInput(ControllerEmu::Translate, _trans("Backward")); | ||
|
|
||
| groups.emplace_back(m_speed_buttons = new ControllerEmu::Buttons(_trans("Speed"))); | ||
|
|
||
| m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease")); | ||
| m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Increase")); | ||
| m_speed_buttons->AddInput(ControllerEmu::Translate, _trans("Reset")); | ||
|
|
||
| groups.emplace_back(m_other_buttons = new ControllerEmu::Buttons(_trans("Other"))); | ||
|
|
||
| m_other_buttons->AddInput(ControllerEmu::Translate, _trans("Reset View")); | ||
|
|
||
| groups.emplace_back(m_fov_buttons = new ControllerEmu::Buttons(_trans("Field of View"))); | ||
|
|
||
| m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Increase X")); | ||
| m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease X")); | ||
| m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Increase Y")); | ||
| m_fov_buttons->AddInput(ControllerEmu::Translate, _trans("Decrease Y")); | ||
| } | ||
|
|
||
| std::string FreeLookController::GetName() const | ||
| { | ||
| return std::string("FreeLook") + char('1' + m_index); | ||
| } | ||
|
|
||
| void FreeLookController::LoadDefaults(const ControllerInterface& ciface) | ||
| { | ||
| EmulatedController::LoadDefaults(ciface); | ||
|
|
||
| auto hotkey_string = [](std::vector<std::string> inputs) { | ||
| return "@(" + JoinStrings(inputs, "+") + ')'; | ||
| }; | ||
|
|
||
| m_move_buttons->SetControlExpression(MoveButtons::Up, hotkey_string({"Shift", "E"})); | ||
| m_move_buttons->SetControlExpression(MoveButtons::Down, hotkey_string({"Shift", "Q"})); | ||
| m_move_buttons->SetControlExpression(MoveButtons::Left, hotkey_string({"Shift", "A"})); | ||
| m_move_buttons->SetControlExpression(MoveButtons::Right, hotkey_string({"Shift", "D"})); | ||
| m_move_buttons->SetControlExpression(MoveButtons::Forward, hotkey_string({"Shift", "W"})); | ||
| m_move_buttons->SetControlExpression(MoveButtons::Backward, hotkey_string({"Shift", "S"})); | ||
|
|
||
| m_speed_buttons->SetControlExpression(SpeedButtons::Decrease, hotkey_string({"Shift", "`1`"})); | ||
| m_speed_buttons->SetControlExpression(SpeedButtons::Increase, hotkey_string({"Shift", "`2`"})); | ||
| m_speed_buttons->SetControlExpression(SpeedButtons::Reset, hotkey_string({"Shift", "F"})); | ||
|
|
||
| m_other_buttons->SetControlExpression(OtherButtons::ResetView, hotkey_string({"Shift", "R"})); | ||
|
|
||
| m_fov_buttons->SetControlExpression(FieldOfViewButtons::IncreaseX, | ||
| hotkey_string({"Shift", "`Axis Z+`"})); | ||
| m_fov_buttons->SetControlExpression(FieldOfViewButtons::DecreaseX, | ||
| hotkey_string({"Shift", "`Axis Z-`"})); | ||
| m_fov_buttons->SetControlExpression(FieldOfViewButtons::IncreaseY, | ||
| hotkey_string({"Shift", "`Axis Z+`"})); | ||
| m_fov_buttons->SetControlExpression(FieldOfViewButtons::DecreaseY, | ||
| hotkey_string({"Shift", "`Axis Z-`"})); | ||
| } | ||
|
|
||
| ControllerEmu::ControlGroup* FreeLookController::GetGroup(FreeLookGroup group) const | ||
| { | ||
| switch (group) | ||
| { | ||
| case FreeLookGroup::Move: | ||
| return m_move_buttons; | ||
| case FreeLookGroup::Speed: | ||
| return m_speed_buttons; | ||
| case FreeLookGroup::FieldOfView: | ||
| return m_fov_buttons; | ||
| case FreeLookGroup::Other: | ||
| return m_other_buttons; | ||
| default: | ||
| return nullptr; | ||
| } | ||
| } | ||
|
|
||
| void FreeLookController::Update() | ||
| { | ||
| if (!g_freelook_camera.IsActive()) | ||
| return; | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Up]->GetState<bool>()) | ||
| g_freelook_camera.MoveVertical(-g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Down]->GetState<bool>()) | ||
| g_freelook_camera.MoveVertical(g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Left]->GetState<bool>()) | ||
| g_freelook_camera.MoveHorizontal(g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Right]->GetState<bool>()) | ||
| g_freelook_camera.MoveHorizontal(-g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Forward]->GetState<bool>()) | ||
| g_freelook_camera.MoveForward(g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_move_buttons->controls[MoveButtons::Backward]->GetState<bool>()) | ||
| g_freelook_camera.MoveForward(-g_freelook_camera.GetSpeed()); | ||
|
|
||
| if (m_fov_buttons->controls[FieldOfViewButtons::IncreaseX]->GetState<bool>()) | ||
| g_freelook_camera.IncreaseFovX(g_freelook_camera.GetFovStepSize()); | ||
|
|
||
| if (m_fov_buttons->controls[FieldOfViewButtons::DecreaseX]->GetState<bool>()) | ||
| g_freelook_camera.IncreaseFovX(-1.0f * g_freelook_camera.GetFovStepSize()); | ||
|
|
||
| if (m_fov_buttons->controls[FieldOfViewButtons::IncreaseY]->GetState<bool>()) | ||
| g_freelook_camera.IncreaseFovY(g_freelook_camera.GetFovStepSize()); | ||
|
|
||
| if (m_fov_buttons->controls[FieldOfViewButtons::DecreaseY]->GetState<bool>()) | ||
| g_freelook_camera.IncreaseFovY(-1.0f * g_freelook_camera.GetFovStepSize()); | ||
|
|
||
| if (m_speed_buttons->controls[SpeedButtons::Decrease]->GetState<bool>()) | ||
| g_freelook_camera.ModifySpeed(1.0f / 1.1f); | ||
|
|
||
| if (m_speed_buttons->controls[SpeedButtons::Increase]->GetState<bool>()) | ||
| g_freelook_camera.ModifySpeed(1.1f); | ||
|
|
||
| if (m_speed_buttons->controls[SpeedButtons::Reset]->GetState<bool>()) | ||
| g_freelook_camera.ResetSpeed(); | ||
|
|
||
| if (m_other_buttons->controls[OtherButtons::ResetView]->GetState<bool>()) | ||
| g_freelook_camera.Reset(); | ||
| } | ||
|
|
||
| namespace FreeLook | ||
| { | ||
| static InputConfig s_config("FreeLookController", _trans("FreeLook"), "FreeLookController"); | ||
| InputConfig* GetInputConfig() | ||
| { | ||
| return &s_config; | ||
| } | ||
|
|
||
| void Shutdown() | ||
| { | ||
| s_config.UnregisterHotplugCallback(); | ||
|
|
||
| s_config.ClearControllers(); | ||
| } | ||
|
|
||
| void Initialize() | ||
| { | ||
| if (s_config.ControllersNeedToBeCreated()) | ||
| { | ||
| s_config.CreateController<FreeLookController>(0); | ||
| } | ||
|
|
||
| s_config.RegisterHotplugCallback(); | ||
|
|
||
| FreeLook::GetConfig().Refresh(); | ||
|
|
||
| s_config.LoadConfig(true); | ||
| } | ||
|
|
||
| void LoadInputConfig() | ||
| { | ||
| s_config.LoadConfig(true); | ||
| } | ||
|
|
||
| bool IsInitialized() | ||
| { | ||
| return !s_config.ControllersNeedToBeCreated(); | ||
| } | ||
|
|
||
| ControllerEmu::ControlGroup* GetInputGroup(int pad_num, FreeLookGroup group) | ||
| { | ||
| return static_cast<FreeLookController*>(s_config.GetController(pad_num))->GetGroup(group); | ||
| } | ||
|
|
||
| void UpdateInput() | ||
| { | ||
| for (int i = 0; i < s_config.GetControllerCount(); i++) | ||
| { | ||
| static_cast<FreeLookController*>(s_config.GetController(i))->Update(); | ||
| } | ||
| } | ||
|
|
||
| } // namespace FreeLook |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "Common/CommonTypes.h" | ||
| #include "InputCommon/ControllerEmu/ControllerEmu.h" | ||
|
|
||
| class InputConfig; | ||
|
|
||
| namespace ControllerEmu | ||
| { | ||
| class ControlGroup; | ||
| class Buttons; | ||
| } // namespace ControllerEmu | ||
|
|
||
| enum class FreeLookGroup | ||
| { | ||
| Move, | ||
| Speed, | ||
| FieldOfView, | ||
| Other | ||
| }; | ||
|
|
||
| namespace FreeLook | ||
| { | ||
| void Shutdown(); | ||
| void Initialize(); | ||
| void LoadInputConfig(); | ||
| bool IsInitialized(); | ||
| void UpdateInput(); | ||
|
|
||
| InputConfig* GetInputConfig(); | ||
| ControllerEmu::ControlGroup* GetInputGroup(int pad_num, FreeLookGroup group); | ||
|
|
||
| } // namespace FreeLook | ||
|
|
||
| class FreeLookController final : public ControllerEmu::EmulatedController | ||
| { | ||
| public: | ||
| explicit FreeLookController(unsigned int index); | ||
|
|
||
| std::string GetName() const override; | ||
| void LoadDefaults(const ControllerInterface& ciface) override; | ||
|
|
||
| ControllerEmu::ControlGroup* GetGroup(FreeLookGroup group) const; | ||
| void Update(); | ||
|
|
||
| private: | ||
| ControllerEmu::Buttons* m_move_buttons; | ||
| ControllerEmu::Buttons* m_speed_buttons; | ||
| ControllerEmu::Buttons* m_fov_buttons; | ||
| ControllerEmu::Buttons* m_other_buttons; | ||
|
|
||
| const unsigned int m_index; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -101,21 +101,7 @@ enum Hotkey | ||
| HK_INCREASE_IR, | ||
| HK_DECREASE_IR, | ||
|
|
||
| HK_FREELOOK_TOGGLE, | ||
|
|
||
| HK_TOGGLE_STEREO_SBS, | ||
| HK_TOGGLE_STEREO_TAB, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #include "DolphinQt/Config/FreeLookWidget.h" | ||
|
|
||
| #include <QCheckBox> | ||
| #include <QHBoxLayout> | ||
| #include <QLabel> | ||
| #include <QPushButton> | ||
| #include <QVBoxLayout> | ||
|
|
||
| #include "Core/Config/FreeLookSettings.h" | ||
| #include "Core/ConfigManager.h" | ||
| #include "Core/Core.h" | ||
|
|
||
| #include "DolphinQt/Config/Graphics/GraphicsChoice.h" | ||
| #include "DolphinQt/Config/Mapping/MappingWindow.h" | ||
| #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" | ||
| #include "DolphinQt/Settings.h" | ||
|
|
||
| FreeLookWidget::FreeLookWidget(QWidget* parent) : QWidget(parent) | ||
| { | ||
| CreateLayout(); | ||
| LoadSettings(); | ||
| ConnectWidgets(); | ||
| } | ||
|
|
||
| void FreeLookWidget::CreateLayout() | ||
| { | ||
| auto* layout = new QVBoxLayout(); | ||
|
|
||
| m_enable_freelook = new ToolTipCheckBox(tr("Enable")); | ||
| m_enable_freelook->setChecked(Config::Get(Config::FREE_LOOK_ENABLED)); | ||
| m_enable_freelook->SetDescription( | ||
| tr("Allows manipulation of the in-game camera.<br><br><dolphin_emphasis>If unsure, " | ||
| "leave this unchecked.</dolphin_emphasis>")); | ||
| m_freelook_controller_configure_button = new QPushButton(tr("Configure Controller")); | ||
|
|
||
| m_freelook_control_type = new GraphicsChoice({tr("Six Axis"), tr("First Person"), tr("Orbital")}, | ||
| Config::FL1_CONTROL_TYPE); | ||
| m_freelook_control_type->SetTitle(tr("Free Look Control Type")); | ||
| m_freelook_control_type->SetDescription(tr( | ||
| "Changes the in-game camera type during Free Look.<br><br>" | ||
| "Six Axis: Offers full camera control on all axes, akin to moving a spacecraft in zero " | ||
| "gravity. This is the most powerful Free Look option but is the most challenging to use.<br> " | ||
| "<br>" | ||
| "First Person: Controls the free camera similarly to a first person video game. The camera " | ||
| "can rotate and travel, but roll is impossible. Easy to use, but limiting.<br><br>" | ||
| "Orbital: Rotates the free camera around the original camera. Has no lateral movement, only " | ||
| "rotation and you may zoom up to the camera's origin point.")); | ||
|
|
||
| auto* description = | ||
| new QLabel(tr("Free Look allows for manipulation of the in-game camera. " | ||
| "Different camera types are available from the dropdown.<br><br>" | ||
| "For detailed instructions, " | ||
| "<a href=\"https://wiki.dolphin-emu.org/index.php?title=Free_Look\">" | ||
| "refer to this page</a>.")); | ||
| description->setTextFormat(Qt::RichText); | ||
| description->setWordWrap(true); | ||
| description->setTextInteractionFlags(Qt::TextBrowserInteraction); | ||
| description->setOpenExternalLinks(true); | ||
|
|
||
| auto* hlayout = new QHBoxLayout(); | ||
| hlayout->addWidget(new QLabel(tr("Camera 1"))); | ||
| hlayout->addWidget(m_freelook_control_type); | ||
| hlayout->addWidget(m_freelook_controller_configure_button); | ||
|
|
||
| layout->addWidget(m_enable_freelook); | ||
| layout->addLayout(hlayout); | ||
| layout->addWidget(description); | ||
|
|
||
| setLayout(layout); | ||
| } | ||
|
|
||
| void FreeLookWidget::ConnectWidgets() | ||
| { | ||
| connect(m_freelook_controller_configure_button, &QPushButton::clicked, this, | ||
| &FreeLookWidget::OnFreeLookControllerConfigured); | ||
| connect(m_enable_freelook, &QCheckBox::clicked, this, &FreeLookWidget::SaveSettings); | ||
| connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] { | ||
| const QSignalBlocker blocker(this); | ||
| LoadSettings(); | ||
| }); | ||
| } | ||
|
|
||
| void FreeLookWidget::OnFreeLookControllerConfigured() | ||
| { | ||
| if (m_freelook_controller_configure_button != QObject::sender()) | ||
| return; | ||
| const int index = 0; | ||
| MappingWindow* window = new MappingWindow(this, MappingWindow::Type::MAPPING_FREELOOK, index); | ||
| window->setAttribute(Qt::WA_DeleteOnClose, true); | ||
| window->setWindowModality(Qt::WindowModality::WindowModal); | ||
| window->show(); | ||
| } | ||
|
|
||
| void FreeLookWidget::LoadSettings() | ||
| { | ||
| const bool checked = Config::Get(Config::FREE_LOOK_ENABLED); | ||
| m_enable_freelook->setChecked(checked); | ||
| m_freelook_control_type->setEnabled(checked); | ||
| m_freelook_controller_configure_button->setEnabled(checked); | ||
| } | ||
|
|
||
| void FreeLookWidget::SaveSettings() | ||
| { | ||
| const bool checked = m_enable_freelook->isChecked(); | ||
| Config::SetBaseOrCurrent(Config::FREE_LOOK_ENABLED, checked); | ||
| m_freelook_control_type->setEnabled(checked); | ||
| m_freelook_controller_configure_button->setEnabled(checked); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <QWidget> | ||
|
|
||
| class GraphicsChoice; | ||
| class QPushButton; | ||
| class ToolTipCheckBox; | ||
|
|
||
| class FreeLookWidget final : public QWidget | ||
| { | ||
| Q_OBJECT | ||
| public: | ||
| explicit FreeLookWidget(QWidget* parent); | ||
|
|
||
| private: | ||
| void CreateLayout(); | ||
| void ConnectWidgets(); | ||
|
|
||
| void OnFreeLookControllerConfigured(); | ||
| void LoadSettings(); | ||
| void SaveSettings(); | ||
|
|
||
| ToolTipCheckBox* m_enable_freelook; | ||
| GraphicsChoice* m_freelook_control_type; | ||
| QPushButton* m_freelook_controller_configure_button; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #include "DolphinQt/Config/FreeLookWindow.h" | ||
|
|
||
| #include <QDialogButtonBox> | ||
| #include <QLabel> | ||
| #include <QTabWidget> | ||
| #include <QVBoxLayout> | ||
|
|
||
| #include "DolphinQt/Config/FreeLookWidget.h" | ||
|
|
||
| FreeLookWindow::FreeLookWindow(QWidget* parent) : QDialog(parent) | ||
| { | ||
| CreateMainLayout(); | ||
|
|
||
| setWindowTitle(tr("Free Look Settings")); | ||
| setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); | ||
| } | ||
|
|
||
| void FreeLookWindow::CreateMainLayout() | ||
| { | ||
| m_button_box = new QDialogButtonBox(QDialogButtonBox::Close); | ||
| connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject); | ||
|
|
||
| auto* main_layout = new QVBoxLayout(); | ||
| main_layout->addWidget(new FreeLookWidget(this)); | ||
| main_layout->addWidget(m_button_box); | ||
| setLayout(main_layout); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <QDialog> | ||
|
|
||
| class QDialogButtonBox; | ||
|
|
||
| class FreeLookWindow final : public QDialog | ||
| { | ||
| Q_OBJECT | ||
| public: | ||
| explicit FreeLookWindow(QWidget* parent); | ||
|
|
||
| private: | ||
| void CreateMainLayout(); | ||
|
|
||
| QDialogButtonBox* m_button_box; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #include "DolphinQt/Config/Mapping/FreeLookGeneral.h" | ||
|
|
||
| #include <QGridLayout> | ||
| #include <QGroupBox> | ||
|
|
||
| #include "Core/FreeLookManager.h" | ||
| #include "InputCommon/InputConfig.h" | ||
|
|
||
| FreeLookGeneral::FreeLookGeneral(MappingWindow* window) : MappingWidget(window) | ||
| { | ||
| CreateMainLayout(); | ||
| } | ||
|
|
||
| void FreeLookGeneral::CreateMainLayout() | ||
| { | ||
| auto* layout = new QGridLayout; | ||
|
|
||
| layout->addWidget( | ||
| CreateGroupBox(tr("Move"), FreeLook::GetInputGroup(GetPort(), FreeLookGroup::Move)), 0, 0); | ||
| layout->addWidget( | ||
| CreateGroupBox(tr("Speed"), FreeLook::GetInputGroup(GetPort(), FreeLookGroup::Speed)), 0, 1); | ||
| layout->addWidget(CreateGroupBox(tr("Field of View"), | ||
| FreeLook::GetInputGroup(GetPort(), FreeLookGroup::FieldOfView)), | ||
| 0, 2); | ||
| layout->addWidget( | ||
| CreateGroupBox(tr("Other"), FreeLook::GetInputGroup(GetPort(), FreeLookGroup::Other)), 0, 3); | ||
|
|
||
| setLayout(layout); | ||
| } | ||
|
|
||
| void FreeLookGeneral::LoadSettings() | ||
| { | ||
| FreeLook::LoadInputConfig(); | ||
| } | ||
|
|
||
| void FreeLookGeneral::SaveSettings() | ||
| { | ||
| FreeLook::GetInputConfig()->SaveConfig(); | ||
| } | ||
|
|
||
| InputConfig* FreeLookGeneral::GetConfig() | ||
| { | ||
| return FreeLook::GetInputConfig(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "DolphinQt/Config/Mapping/MappingWidget.h" | ||
|
|
||
| class FreeLookGeneral final : public MappingWidget | ||
| { | ||
| Q_OBJECT | ||
| public: | ||
| explicit FreeLookGeneral(MappingWindow* window); | ||
|
|
||
| InputConfig* GetConfig() override; | ||
|
|
||
| private: | ||
| void LoadSettings() override; | ||
| void SaveSettings() override; | ||
| void CreateMainLayout(); | ||
| }; |