2017-05-20 15:53:17 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-05-20 15:53:17 +00:00
|
|
|
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Config/Mapping/GCPadEmu.h"
|
2018-05-28 01:48:04 +00:00
|
|
|
|
2019-03-16 16:55:47 +00:00
|
|
|
#include <QGridLayout>
|
2017-05-20 15:53:17 +00:00
|
|
|
#include <QGroupBox>
|
|
|
|
|
|
|
|
#include "Core/HW/GCPad.h"
|
|
|
|
#include "Core/HW/GCPadEmu.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()
|
|
|
|
{
|
2019-03-16 16:55:47 +00:00
|
|
|
auto* layout = new QGridLayout;
|
|
|
|
|
|
|
|
layout->addWidget(CreateGroupBox(tr("Buttons"), Pad::GetGroup(GetPort(), PadGroup::Buttons)), 0,
|
2019-04-27 19:23:29 +00:00
|
|
|
0);
|
|
|
|
layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad)), 1, 0, -1,
|
|
|
|
1);
|
2019-03-16 16:55:47 +00:00
|
|
|
layout->addWidget(
|
|
|
|
CreateGroupBox(tr("Control Stick"), Pad::GetGroup(GetPort(), PadGroup::MainStick)), 0, 1, -1,
|
|
|
|
1);
|
|
|
|
layout->addWidget(CreateGroupBox(tr("C Stick"), Pad::GetGroup(GetPort(), PadGroup::CStick)), 0, 2,
|
|
|
|
-1, 1);
|
|
|
|
layout->addWidget(CreateGroupBox(tr("Triggers"), Pad::GetGroup(GetPort(), PadGroup::Triggers)), 0,
|
|
|
|
4);
|
|
|
|
layout->addWidget(CreateGroupBox(tr("Rumble"), Pad::GetGroup(GetPort(), PadGroup::Rumble)), 1, 4);
|
|
|
|
|
|
|
|
layout->addWidget(CreateGroupBox(tr("Options"), Pad::GetGroup(GetPort(), PadGroup::Options)), 2,
|
|
|
|
4);
|
|
|
|
|
|
|
|
setLayout(layout);
|
2017-05-20 15:53:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GCPadEmu::LoadSettings()
|
|
|
|
{
|
|
|
|
Pad::LoadConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GCPadEmu::SaveSettings()
|
|
|
|
{
|
|
|
|
Pad::GetConfig()->SaveConfig();
|
|
|
|
}
|
|
|
|
|
|
|
|
InputConfig* GCPadEmu::GetConfig()
|
|
|
|
{
|
|
|
|
return Pad::GetConfig();
|
|
|
|
}
|