DolphinQt: Move Free Look out of Graphics/Hotkey and into its own configuration window. Launched from a new menu option - "Free Look Settings". The HotKeyScheduler still calls the Free Look functionality to reduce the total number of threads
This commit is contained in:
parent
9ac6090c9a
commit
9a744ab25b
|
@ -71,6 +71,10 @@ add_executable(dolphin-emu
|
|||
Config/ControllersWindow.h
|
||||
Config/FilesystemWidget.cpp
|
||||
Config/FilesystemWidget.h
|
||||
Config/FreeLookWidget.cpp
|
||||
Config/FreeLookWidget.h
|
||||
Config/FreeLookWindow.cpp
|
||||
Config/FreeLookWindow.h
|
||||
Config/GameConfigEdit.cpp
|
||||
Config/GameConfigEdit.h
|
||||
Config/GameConfigHighlighter.cpp
|
||||
|
@ -112,6 +116,8 @@ add_executable(dolphin-emu
|
|||
Config/LogConfigWidget.h
|
||||
Config/LogWidget.cpp
|
||||
Config/LogWidget.h
|
||||
Config/Mapping/FreeLookGeneral.cpp
|
||||
Config/Mapping/FreeLookGeneral.h
|
||||
Config/Mapping/GCKeyboardEmu.cpp
|
||||
Config/Mapping/GCKeyboardEmu.h
|
||||
Config/Mapping/GCMicrophone.cpp
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
};
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
};
|
|
@ -80,19 +80,6 @@ void AdvancedWidget::CreateWidgets()
|
|||
|
||||
utility_layout->addWidget(m_dump_efb_target, 1, 1);
|
||||
|
||||
// Freelook
|
||||
auto* freelook_box = new QGroupBox(tr("Free Look"));
|
||||
auto* freelook_layout = new QGridLayout();
|
||||
freelook_box->setLayout(freelook_layout);
|
||||
|
||||
m_enable_freelook = new GraphicsBool(tr("Enable"), Config::GFX_FREE_LOOK);
|
||||
m_freelook_control_type = new GraphicsChoice({tr("Six Axis"), tr("First Person"), tr("Orbital")},
|
||||
Config::GFX_FREE_LOOK_CONTROL_TYPE);
|
||||
|
||||
freelook_layout->addWidget(m_enable_freelook, 0, 0);
|
||||
freelook_layout->addWidget(new QLabel(tr("Control Type:")), 1, 0);
|
||||
freelook_layout->addWidget(m_freelook_control_type, 1, 1);
|
||||
|
||||
// Texture dumping
|
||||
auto* texture_dump_box = new QGroupBox(tr("Texture Dumping"));
|
||||
auto* texture_dump_layout = new QGridLayout();
|
||||
|
@ -155,7 +142,6 @@ void AdvancedWidget::CreateWidgets()
|
|||
|
||||
main_layout->addWidget(debugging_box);
|
||||
main_layout->addWidget(utility_box);
|
||||
main_layout->addWidget(freelook_box);
|
||||
main_layout->addWidget(texture_dump_box);
|
||||
main_layout->addWidget(dump_box);
|
||||
main_layout->addWidget(misc_box);
|
||||
|
@ -170,7 +156,6 @@ void AdvancedWidget::ConnectWidgets()
|
|||
connect(m_load_custom_textures, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_dump_use_ffv1, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_enable_prog_scan, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_enable_freelook, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
connect(m_dump_textures, &QCheckBox::toggled, this, &AdvancedWidget::SaveSettings);
|
||||
}
|
||||
|
||||
|
@ -180,8 +165,6 @@ void AdvancedWidget::LoadSettings()
|
|||
m_dump_bitrate->setEnabled(!Config::Get(Config::GFX_USE_FFV1));
|
||||
|
||||
m_enable_prog_scan->setChecked(Config::Get(Config::SYSCONF_PROGRESSIVE_SCAN));
|
||||
|
||||
m_freelook_control_type->setEnabled(Config::Get(Config::GFX_FREE_LOOK));
|
||||
m_dump_mip_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
m_dump_base_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
}
|
||||
|
@ -192,8 +175,6 @@ void AdvancedWidget::SaveSettings()
|
|||
m_dump_bitrate->setEnabled(!Config::Get(Config::GFX_USE_FFV1));
|
||||
|
||||
Config::SetBase(Config::SYSCONF_PROGRESSIVE_SCAN, m_enable_prog_scan->isChecked());
|
||||
|
||||
m_freelook_control_type->setEnabled(Config::Get(Config::GFX_FREE_LOOK));
|
||||
m_dump_mip_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
m_dump_base_textures->setEnabled(Config::Get(Config::GFX_DUMP_TEXTURES));
|
||||
}
|
||||
|
@ -268,22 +249,6 @@ void AdvancedWidget::AddDescriptions()
|
|||
QT_TR_NOOP("Encodes frame dumps using the FFV1 codec.<br><br><dolphin_emphasis>If "
|
||||
"unsure, leave this unchecked.</dolphin_emphasis>");
|
||||
#endif
|
||||
static const char TR_FREE_LOOK_DESCRIPTION[] = QT_TR_NOOP(
|
||||
"Allows manipulation of the in-game camera. Move the mouse while holding the right button "
|
||||
"to pan or middle button to roll.<br><br>Use the WASD keys while holding SHIFT to move "
|
||||
"the "
|
||||
"camera. Press SHIFT+2 to increase speed or SHIFT+1 to decrease speed. Press SHIFT+R "
|
||||
"to reset the camera or SHIFT+F to reset the speed.<br><br><dolphin_emphasis>If unsure, "
|
||||
"leave this unchecked.</dolphin_emphasis>");
|
||||
static const char TR_FREE_LOOK_CONTROL_TYPE_DESCRIPTION[] = QT_TR_NOOP(
|
||||
"Changes the in-game camera type during freelook.<br><br>"
|
||||
"Six Axis: Offers full camera control on all axes, akin to moving a spacecraft in zero "
|
||||
"gravity. This is the most powerful freelook 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.");
|
||||
static const char TR_CROPPING_DESCRIPTION[] = QT_TR_NOOP(
|
||||
"Crops the picture from its native aspect ratio to 4:3 or "
|
||||
"16:9.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
|
||||
|
@ -330,9 +295,6 @@ void AdvancedWidget::AddDescriptions()
|
|||
#endif
|
||||
m_enable_cropping->SetDescription(tr(TR_CROPPING_DESCRIPTION));
|
||||
m_enable_prog_scan->SetDescription(tr(TR_PROGRESSIVE_SCAN_DESCRIPTION));
|
||||
m_enable_freelook->SetDescription(tr(TR_FREE_LOOK_DESCRIPTION));
|
||||
m_freelook_control_type->SetTitle(tr("Free Look Control Type"));
|
||||
m_freelook_control_type->SetDescription(tr(TR_FREE_LOOK_CONTROL_TYPE_DESCRIPTION));
|
||||
m_backend_multithreading->SetDescription(tr(TR_BACKEND_MULTITHREADING_DESCRIPTION));
|
||||
#ifdef _WIN32
|
||||
m_borderless_fullscreen->SetDescription(tr(TR_BORDERLESS_FULLSCREEN_DESCRIPTION));
|
||||
|
|
|
@ -42,8 +42,6 @@ private:
|
|||
GraphicsBool* m_dump_efb_target;
|
||||
GraphicsBool* m_disable_vram_copies;
|
||||
GraphicsBool* m_load_custom_textures;
|
||||
GraphicsBool* m_enable_freelook;
|
||||
GraphicsChoice* m_freelook_control_type;
|
||||
|
||||
// Texture dumping
|
||||
GraphicsBool* m_dump_textures;
|
||||
|
|
|
@ -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();
|
||||
}
|
|
@ -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();
|
||||
};
|
|
@ -18,12 +18,12 @@ void HotkeyGraphics::CreateMainLayout()
|
|||
{
|
||||
m_main_layout = new QGridLayout();
|
||||
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(tr("Freelook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK)), 0, 0, -1, 1);
|
||||
|
||||
m_main_layout->addWidget(CreateGroupBox(tr("Graphics Toggles"),
|
||||
HotkeyManagerEmu::GetHotkeyGroup(HKGP_GRAPHICS_TOGGLES)),
|
||||
0, 1);
|
||||
0, 0, -1, 1);
|
||||
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(tr("FreeLook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK)), 0, 1);
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(tr("Internal Resolution"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_IR)), 1, 1);
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "Common/IniFile.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "DolphinQt/Config/Mapping/FreeLookGeneral.h"
|
||||
#include "DolphinQt/Config/Mapping/GCKeyboardEmu.h"
|
||||
#include "DolphinQt/Config/Mapping/GCMicrophone.h"
|
||||
#include "DolphinQt/Config/Mapping/GCPadEmu.h"
|
||||
|
@ -428,6 +429,13 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
|||
setWindowTitle(tr("Hotkey Settings"));
|
||||
break;
|
||||
}
|
||||
case Type::MAPPING_FREELOOK:
|
||||
{
|
||||
widget = new FreeLookGeneral(this);
|
||||
AddWidget(tr("General"), widget);
|
||||
setWindowTitle(tr("Free Look Controller %1").arg(GetPort() + 1));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,9 @@ public:
|
|||
// Wii
|
||||
MAPPING_WIIMOTE_EMU,
|
||||
// Hotkeys
|
||||
MAPPING_HOTKEYS
|
||||
MAPPING_HOTKEYS,
|
||||
// Freelook
|
||||
MAPPING_FREELOOK,
|
||||
};
|
||||
|
||||
explicit MappingWindow(QWidget* parent, Type type, int port_num);
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
<ClCompile Include="Config\ControllerInterface\ServerStringValidator.cpp" />
|
||||
<ClCompile Include="Config\ControllersWindow.cpp" />
|
||||
<ClCompile Include="Config\FilesystemWidget.cpp" />
|
||||
<ClCompile Include="Config\FreeLookWidget.cpp" />
|
||||
<ClCompile Include="Config\FreeLookWindow.cpp" />
|
||||
<ClCompile Include="Config\GameConfigEdit.cpp" />
|
||||
<ClCompile Include="Config\GameConfigHighlighter.cpp" />
|
||||
<ClCompile Include="Config\GameConfigWidget.cpp" />
|
||||
|
@ -75,6 +77,7 @@
|
|||
<ClCompile Include="Config\InfoWidget.cpp" />
|
||||
<ClCompile Include="Config\LogConfigWidget.cpp" />
|
||||
<ClCompile Include="Config\LogWidget.cpp" />
|
||||
<ClCompile Include="Config\Mapping\FreeLookGeneral.cpp" />
|
||||
<ClCompile Include="Config\Mapping\GCKeyboardEmu.cpp" />
|
||||
<ClCompile Include="Config\Mapping\GCMicrophone.cpp" />
|
||||
<ClCompile Include="Config\Mapping\GCPadEmu.cpp" />
|
||||
|
@ -223,6 +226,8 @@
|
|||
<QtMoc Include="Config\ControllerInterface\ServerStringValidator.h" />
|
||||
<QtMoc Include="Config\ControllersWindow.h" />
|
||||
<QtMoc Include="Config\FilesystemWidget.h" />
|
||||
<QtMoc Include="Config\FreeLookWidget.h" />
|
||||
<QtMoc Include="Config\FreeLookWindow.h" />
|
||||
<QtMoc Include="Config\GameConfigHighlighter.h" />
|
||||
<QtMoc Include="Config\GameConfigWidget.h" />
|
||||
<QtMoc Include="Config\GeckoCodeWidget.h" />
|
||||
|
@ -243,6 +248,7 @@
|
|||
<QtMoc Include="Config\InfoWidget.h" />
|
||||
<QtMoc Include="Config\LogConfigWidget.h" />
|
||||
<QtMoc Include="Config\LogWidget.h" />
|
||||
<QtMoc Include="Config\Mapping\FreeLookGeneral.h" />
|
||||
<QtMoc Include="Config\Mapping\GCKeyboardEmu.h" />
|
||||
<QtMoc Include="Config\Mapping\GCMicrophone.h" />
|
||||
<QtMoc Include="Config\Mapping\GCPadEmu.h" />
|
||||
|
|
|
@ -15,10 +15,12 @@
|
|||
#include "Common/Config/Config.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
#include "Core/Config/FreeLookSettings.h"
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/Config/UISettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/FreeLookManager.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/HotkeyManager.h"
|
||||
#include "Core/IOS/IOS.h"
|
||||
|
@ -30,7 +32,6 @@
|
|||
#include "InputCommon/ControlReference/ControlReference.h"
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
|
||||
#include "VideoCommon/FreeLookCamera.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
#include "VideoCommon/VertexShaderManager.h"
|
||||
|
@ -537,57 +538,15 @@ void HotkeyScheduler::Run()
|
|||
Config::SetCurrent(Config::GFX_STEREO_CONVERGENCE,
|
||||
std::min(stereo_convergence + 5, Config::GFX_STEREO_CONVERGENCE_MAXIMUM));
|
||||
|
||||
// Freelook
|
||||
static float fl_speed = 1.0;
|
||||
|
||||
// Free Look
|
||||
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"));
|
||||
const bool new_value = !Config::Get(Config::FREE_LOOK_ENABLED);
|
||||
Config::SetCurrent(Config::FREE_LOOK_ENABLED, new_value);
|
||||
OSD::AddMessage(StringFromFormat("Free Look: %s", new_value ? "Enabled" : "Disabled"));
|
||||
}
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_DECREASE_SPEED, true))
|
||||
fl_speed /= 1.1f;
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_INCREASE_SPEED, true))
|
||||
fl_speed *= 1.1f;
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_RESET_SPEED, true))
|
||||
fl_speed = 1.0;
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_UP, true))
|
||||
g_freelook_camera.MoveVertical(-fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_DOWN, true))
|
||||
g_freelook_camera.MoveVertical(fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_LEFT, true))
|
||||
g_freelook_camera.MoveHorizontal(fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_RIGHT, true))
|
||||
g_freelook_camera.MoveHorizontal(-fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_ZOOM_IN, true))
|
||||
g_freelook_camera.Zoom(fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_ZOOM_OUT, true))
|
||||
g_freelook_camera.Zoom(-fl_speed);
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_INCREASE_FOV_X, true))
|
||||
g_freelook_camera.IncreaseFovX(g_freelook_camera.GetFovStepSize());
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_DECREASE_FOV_X, true))
|
||||
g_freelook_camera.IncreaseFovX(-1.0f * g_freelook_camera.GetFovStepSize());
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_INCREASE_FOV_Y, true))
|
||||
g_freelook_camera.IncreaseFovY(g_freelook_camera.GetFovStepSize());
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_DECREASE_FOV_Y, true))
|
||||
g_freelook_camera.IncreaseFovY(-1.0f * g_freelook_camera.GetFovStepSize());
|
||||
|
||||
if (IsHotkey(HK_FREELOOK_RESET, true))
|
||||
g_freelook_camera.Reset();
|
||||
FreeLook::UpdateInput();
|
||||
|
||||
// Savestates
|
||||
for (u32 i = 0; i < State::NUM_STATES; i++)
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/FreeLookManager.h"
|
||||
#include "Core/HW/DVD/DVDInterface.h"
|
||||
#include "Core/HW/GCKeyboard.h"
|
||||
#include "Core/HW/GCPad.h"
|
||||
|
@ -62,6 +63,7 @@
|
|||
#include "DolphinQt/AboutDialog.h"
|
||||
#include "DolphinQt/CheatsManager.h"
|
||||
#include "DolphinQt/Config/ControllersWindow.h"
|
||||
#include "DolphinQt/Config/FreeLookWindow.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/LogConfigWidget.h"
|
||||
#include "DolphinQt/Config/LogWidget.h"
|
||||
|
@ -302,6 +304,7 @@ void MainWindow::InitControllers()
|
|||
Pad::Initialize();
|
||||
Keyboard::Initialize();
|
||||
Wiimote::Initialize(Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES);
|
||||
FreeLook::Initialize();
|
||||
m_hotkey_scheduler = new HotkeyScheduler();
|
||||
m_hotkey_scheduler->Start();
|
||||
|
||||
|
@ -315,6 +318,9 @@ void MainWindow::InitControllers()
|
|||
|
||||
Keyboard::LoadConfig();
|
||||
Keyboard::GetConfig()->SaveConfig();
|
||||
|
||||
FreeLook::LoadInputConfig();
|
||||
FreeLook::GetInputConfig()->SaveConfig();
|
||||
}
|
||||
|
||||
void MainWindow::ShutdownControllers()
|
||||
|
@ -325,6 +331,7 @@ void MainWindow::ShutdownControllers()
|
|||
Keyboard::Shutdown();
|
||||
Wiimote::Shutdown();
|
||||
HotkeyManagerEmu::Shutdown();
|
||||
FreeLook::Shutdown();
|
||||
g_controller_interface.Shutdown();
|
||||
|
||||
m_hotkey_scheduler->deleteLater();
|
||||
|
@ -479,6 +486,7 @@ void MainWindow::ConnectMenuBar()
|
|||
connect(m_menu_bar, &MenuBar::ConfigureAudio, this, &MainWindow::ShowAudioWindow);
|
||||
connect(m_menu_bar, &MenuBar::ConfigureControllers, this, &MainWindow::ShowControllersWindow);
|
||||
connect(m_menu_bar, &MenuBar::ConfigureHotkeys, this, &MainWindow::ShowHotkeyDialog);
|
||||
connect(m_menu_bar, &MenuBar::ConfigureFreelook, this, &MainWindow::ShowFreeLookWindow);
|
||||
|
||||
// Tools
|
||||
connect(m_menu_bar, &MenuBar::ShowMemcardManager, this, &MainWindow::ShowMemcardManager);
|
||||
|
@ -1101,6 +1109,19 @@ void MainWindow::ShowControllersWindow()
|
|||
m_controllers_window->activateWindow();
|
||||
}
|
||||
|
||||
void MainWindow::ShowFreeLookWindow()
|
||||
{
|
||||
if (!m_freelook_window)
|
||||
{
|
||||
m_freelook_window = new FreeLookWindow(this);
|
||||
InstallHotkeyFilter(m_freelook_window);
|
||||
}
|
||||
|
||||
m_freelook_window->show();
|
||||
m_freelook_window->raise();
|
||||
m_freelook_window->activateWindow();
|
||||
}
|
||||
|
||||
void MainWindow::ShowSettingsWindow()
|
||||
{
|
||||
if (!m_settings_window)
|
||||
|
|
|
@ -23,6 +23,7 @@ class ControllersWindow;
|
|||
class DiscordHandler;
|
||||
class DragEnterEvent;
|
||||
class FIFOPlayerWindow;
|
||||
class FreeLookWindow;
|
||||
class GameList;
|
||||
class GCTASInputWindow;
|
||||
class GraphicsWindow;
|
||||
|
@ -147,6 +148,7 @@ private:
|
|||
void ShowAudioWindow();
|
||||
void ShowControllersWindow();
|
||||
void ShowGraphicsWindow();
|
||||
void ShowFreeLookWindow();
|
||||
void ShowAboutDialog();
|
||||
void ShowHotkeyDialog();
|
||||
void ShowNetPlaySetupDialog();
|
||||
|
@ -213,6 +215,7 @@ private:
|
|||
GraphicsWindow* m_graphics_window = nullptr;
|
||||
FIFOPlayerWindow* m_fifo_window = nullptr;
|
||||
MappingWindow* m_hotkey_window = nullptr;
|
||||
FreeLookWindow* m_freelook_window = nullptr;
|
||||
|
||||
HotkeyScheduler* m_hotkey_scheduler;
|
||||
NetPlayDialog* m_netplay_dialog;
|
||||
|
|
|
@ -528,6 +528,7 @@ void MenuBar::AddOptionsMenu()
|
|||
m_controllers_action =
|
||||
options_menu->addAction(tr("&Controller Settings"), this, &MenuBar::ConfigureControllers);
|
||||
options_menu->addAction(tr("&Hotkey Settings"), this, &MenuBar::ConfigureHotkeys);
|
||||
options_menu->addAction(tr("&Free Look Settings"), this, &MenuBar::ConfigureFreelook);
|
||||
|
||||
options_menu->addSeparator();
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ signals:
|
|||
void ConfigureAudio();
|
||||
void ConfigureControllers();
|
||||
void ConfigureHotkeys();
|
||||
void ConfigureFreelook();
|
||||
|
||||
// View
|
||||
void ShowList();
|
||||
|
|
Loading…
Reference in New Issue