mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
e149ad4f0a
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
// Copyright 2019 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "DolphinQt/Config/Mapping/WiimoteEmuExtensionMotionSimulation.h"
|
|
|
|
#include <QGridLayout>
|
|
#include <QGroupBox>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
|
|
#include "Core/HW/Wiimote.h"
|
|
#include "Core/HW/WiimoteEmu/Extension/Nunchuk.h"
|
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
|
|
|
#include "InputCommon/InputConfig.h"
|
|
|
|
WiimoteEmuExtensionMotionSimulation::WiimoteEmuExtensionMotionSimulation(MappingWindow* window)
|
|
: MappingWidget(window)
|
|
{
|
|
CreateNunchukLayout();
|
|
CreateMainLayout();
|
|
}
|
|
|
|
void WiimoteEmuExtensionMotionSimulation::CreateNunchukLayout()
|
|
{
|
|
auto* layout = new QGridLayout();
|
|
m_nunchuk_box = new QGroupBox(tr("Nunchuk"), this);
|
|
|
|
layout->addWidget(CreateGroupBox(tr("Shake"), Wiimote::GetNunchukGroup(
|
|
GetPort(), WiimoteEmu::NunchukGroup::Shake)),
|
|
0, 0);
|
|
layout->addWidget(CreateGroupBox(tr("Tilt"), Wiimote::GetNunchukGroup(
|
|
GetPort(), WiimoteEmu::NunchukGroup::Tilt)),
|
|
0, 1);
|
|
layout->addWidget(CreateGroupBox(tr("Swing"), Wiimote::GetNunchukGroup(
|
|
GetPort(), WiimoteEmu::NunchukGroup::Swing)),
|
|
0, 2);
|
|
|
|
m_nunchuk_box->setLayout(layout);
|
|
}
|
|
|
|
void WiimoteEmuExtensionMotionSimulation::CreateMainLayout()
|
|
{
|
|
m_main_layout = new QHBoxLayout();
|
|
|
|
m_main_layout->addWidget(m_nunchuk_box);
|
|
|
|
setLayout(m_main_layout);
|
|
}
|
|
|
|
void WiimoteEmuExtensionMotionSimulation::LoadSettings()
|
|
{
|
|
Wiimote::LoadConfig();
|
|
}
|
|
|
|
void WiimoteEmuExtensionMotionSimulation::SaveSettings()
|
|
{
|
|
Wiimote::GetConfig()->SaveConfig();
|
|
}
|
|
|
|
InputConfig* WiimoteEmuExtensionMotionSimulation::GetConfig()
|
|
{
|
|
return Wiimote::GetConfig();
|
|
}
|