2017-05-20 15:53:17 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2018-05-28 01:48:04 +00:00
|
|
|
#include "DolphinQt2/Config/Mapping/GCPadEmu.h"
|
|
|
|
|
2017-05-20 15:53:17 +00:00
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
#include "Core/HW/GCPad.h"
|
|
|
|
#include "Core/HW/GCPadEmu.h"
|
|
|
|
|
2018-05-29 17:34:35 +00:00
|
|
|
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
|
2018-06-19 08:47:18 +00:00
|
|
|
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
2018-05-28 01:48:04 +00:00
|
|
|
#include "InputCommon/InputConfig.h"
|
|
|
|
|
2017-05-20 15:53:17 +00:00
|
|
|
GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window)
|
|
|
|
{
|
|
|
|
CreateMainLayout();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GCPadEmu::CreateMainLayout()
|
|
|
|
{
|
|
|
|
m_main_layout = new QHBoxLayout();
|
|
|
|
|
|
|
|
m_main_layout->addWidget(
|
|
|
|
CreateGroupBox(tr("Buttons"), Pad::GetGroup(GetPort(), PadGroup::Buttons)));
|
|
|
|
m_main_layout->addWidget(
|
|
|
|
CreateGroupBox(tr("Control Stick"), Pad::GetGroup(GetPort(), PadGroup::MainStick)));
|
|
|
|
m_main_layout->addWidget(
|
2017-07-23 10:58:32 +00:00
|
|
|
CreateGroupBox(tr("C Stick"), Pad::GetGroup(GetPort(), PadGroup::CStick)));
|
2017-05-20 15:53:17 +00:00
|
|
|
m_main_layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad)));
|
2018-04-01 14:25:34 +00:00
|
|
|
|
|
|
|
auto* hbox_layout = new QVBoxLayout();
|
|
|
|
|
2018-05-08 23:54:47 +00:00
|
|
|
m_main_layout->addLayout(hbox_layout);
|
2017-05-20 15:53:17 +00:00
|
|
|
|
2018-04-01 14:25:34 +00:00
|
|
|
hbox_layout->addWidget(
|
|
|
|
CreateGroupBox(tr("Triggers"), Pad::GetGroup(GetPort(), PadGroup::Triggers)));
|
|
|
|
hbox_layout->addWidget(CreateGroupBox(tr("Rumble"), Pad::GetGroup(GetPort(), PadGroup::Rumble)));
|
|
|
|
|
2018-06-21 22:16:28 +00:00
|
|
|
hbox_layout->addWidget(
|
|
|
|
CreateGroupBox(tr("Options"), Pad::GetGroup(GetPort(), PadGroup::Options)));
|
2018-05-29 17:34:35 +00:00
|
|
|
|
2017-05-20 15:53:17 +00:00
|
|
|
setLayout(m_main_layout);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GCPadEmu::LoadSettings()
|
|
|
|
{
|
|
|
|
Pad::LoadConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GCPadEmu::SaveSettings()
|
|
|
|
{
|
|
|
|
Pad::GetConfig()->SaveConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
InputConfig* GCPadEmu::GetConfig()
|
|
|
|
{
|
|
|
|
return Pad::GetConfig();
|
|
|
|
}
|