DolphinQt: Add Triforce tab to main settings window.
This commit is contained in:
1 parent
0fc8f463f2
commit
f00b1c590e
16 files changed
+156
-89
No files matched your search
@@ -133,7 +133,6 @@ void GamecubeControllersWidget::OnGCPadConfigure(size_t index)
|
||||
case SerialInterface::SIDEVICE_NONE:
|
||||
case SerialInterface::SIDEVICE_GC_GBA:
|
||||
return;
|
||||
case SerialInterface::SIDEVICE_AM_BASEBOARD:
|
||||
case SerialInterface::SIDEVICE_GC_CONTROLLER:
|
||||
type = MappingWindow::Type::MAPPING_GCPAD;
|
||||
break;
|
||||
@@ -158,6 +157,9 @@ void GamecubeControllersWidget::OnGCPadConfigure(size_t index)
|
||||
case SerialInterface::SIDEVICE_GC_KEYBOARD:
|
||||
type = MappingWindow::Type::MAPPING_GC_KEYBOARD;
|
||||
break;
|
||||
case SerialInterface::SIDEVICE_AM_BASEBOARD:
|
||||
type = MappingWindow::Type::MAPPING_AM_BASEBOARD;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,19 +8,15 @@
|
||||
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/HW/GCPadEmu.h"
|
||||
#include "Core/HW/SI/SI.h"
|
||||
#include "Core/HW/SI/SI_DeviceAMBaseboard.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window)
|
||||
GCPadEmu::GCPadEmu(MappingWindow* window, SubType sub_type) : MappingWidget(window)
|
||||
{
|
||||
CreateMainLayout();
|
||||
CreateMainLayout(sub_type);
|
||||
}
|
||||
|
||||
void GCPadEmu::CreateMainLayout()
|
||||
void GCPadEmu::CreateMainLayout(SubType sub_type)
|
||||
{
|
||||
auto* layout = new QGridLayout;
|
||||
|
||||
@@ -28,8 +24,7 @@ void GCPadEmu::CreateMainLayout()
|
||||
0);
|
||||
layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad)), 1, 0);
|
||||
|
||||
if (Config::Get(Config::GetInfoForSIDevice(0)) ==
|
||||
SerialInterface::SIDevices::SIDEVICE_AM_BASEBOARD)
|
||||
if (sub_type == SubType::AMBaseboard)
|
||||
{
|
||||
layout->addWidget(CreateGroupBox(tr("Triforce"), Pad::GetGroup(GetPort(), PadGroup::Triforce)),
|
||||
2, 0);
|
||||
|
||||
@@ -9,12 +9,28 @@ class GCPadEmu final : public MappingWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GCPadEmu(MappingWindow* window);
|
||||
enum class SubType
|
||||
{
|
||||
StandardController,
|
||||
AMBaseboard,
|
||||
};
|
||||
|
||||
GCPadEmu(MappingWindow* window, SubType sub_type);
|
||||
|
||||
InputConfig* GetConfig() override;
|
||||
|
||||
private:
|
||||
void LoadSettings() override;
|
||||
void SaveSettings() override;
|
||||
void CreateMainLayout();
|
||||
void CreateMainLayout(SubType sub_type);
|
||||
};
|
||||
|
||||
[[nodiscard]] inline auto CreateStandardControllerMappingWidget(MappingWindow* parent)
|
||||
{
|
||||
return new GCPadEmu{parent, GCPadEmu::SubType::StandardController};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline auto CreateAMBaseboardMappingWidget(MappingWindow* parent)
|
||||
{
|
||||
return new GCPadEmu{parent, GCPadEmu::SubType::AMBaseboard};
|
||||
}
|
||||
@@ -460,18 +460,9 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
||||
case Type::MAPPING_GC_STEERINGWHEEL:
|
||||
case Type::MAPPING_GC_DANCEMAT:
|
||||
case Type::MAPPING_GCPAD:
|
||||
widget = new GCPadEmu(this);
|
||||
if (Config::Get(Config::GetInfoForSIDevice(GetPort())) ==
|
||||
SerialInterface::SIDevices::SIDEVICE_AM_BASEBOARD)
|
||||
{
|
||||
setWindowTitle(tr("Triforce Baseboard at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("Triforce Baseboard"), widget);
|
||||
}
|
||||
else
|
||||
{
|
||||
setWindowTitle(tr("GameCube Controller at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("GameCube Controller"), widget);
|
||||
}
|
||||
widget = CreateStandardControllerMappingWidget(this);
|
||||
setWindowTitle(tr("GameCube Controller at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("GameCube Controller"), widget);
|
||||
break;
|
||||
case Type::MAPPING_GC_MICROPHONE:
|
||||
widget = new GCMicrophone(this);
|
||||
@@ -528,6 +519,11 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
||||
setWindowTitle(tr("Free Look Controller %1").arg(GetPort() + 1));
|
||||
}
|
||||
break;
|
||||
case Type::MAPPING_AM_BASEBOARD:
|
||||
widget = CreateAMBaseboardMappingWidget(this);
|
||||
setWindowTitle(tr("Triforce Baseboard at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("Triforce Baseboard"), widget);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
MAPPING_HOTKEYS,
|
||||
// Freelook
|
||||
MAPPING_FREELOOK,
|
||||
// Triforce
|
||||
MAPPING_AM_BASEBOARD,
|
||||
};
|
||||
|
||||
explicit MappingWindow(QWidget* parent, Type type, int port_num);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "DolphinQt/Settings/InterfacePane.h"
|
||||
#include "DolphinQt/Settings/OnScreenDisplayPane.h"
|
||||
#include "DolphinQt/Settings/PathPane.h"
|
||||
#include "DolphinQt/Settings/TriforcePane.h"
|
||||
#include "DolphinQt/Settings/WiiPane.h"
|
||||
|
||||
StackedSettingsWindow::StackedSettingsWindow(QWidget* parent) : QDialog{parent}
|
||||
@@ -197,8 +198,9 @@ SettingsWindow::SettingsWindow(MainWindow* parent) : StackedSettingsWindow{paren
|
||||
AddWrappedPane(new OnScreenDisplayPane, tr("On-Screen Display"));
|
||||
AddWrappedPane(new AudioPane, tr("Audio"));
|
||||
AddWrappedPane(new PathPane, tr("Paths"));
|
||||
AddWrappedPane(new GameCubePane, tr("GameCube"));
|
||||
AddWrappedPane(new GameCubePane{parent}, tr("GameCube"));
|
||||
AddWrappedPane(new WiiPane, tr("Wii"));
|
||||
AddWrappedPane(new TriforcePane, tr("Triforce"));
|
||||
AddWrappedPane(new AdvancedPane, tr("Advanced"));
|
||||
|
||||
OnDoneCreatingPanes();
|
||||
|
||||
@@ -49,6 +49,7 @@ enum class SettingsWindowPaneIndex : int
|
||||
Paths,
|
||||
GameCube,
|
||||
Wii,
|
||||
Triforce,
|
||||
Advanced,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user