-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
881 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include <QFormLayout> | ||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
#include <QVBoxLayout> | ||
|
||
#include "Core/HW/GCPad.h" | ||
#include "Core/HW/GCPadEmu.h" | ||
|
||
#include "DolphinQt2/Config/Mapping/GCPadEmu.h" | ||
|
||
GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
// ConnectWidgets(); | ||
} | ||
|
||
void GCPadEmu::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
auto* hbox_layout = new QVBoxLayout(); | ||
hbox_layout->addWidget( | ||
CreateGroupBox(tr("Triggers"), Pad::GetGroup(GetPort(), PadGroup::Triggers))); | ||
hbox_layout->addWidget(CreateGroupBox(tr("Rumble"), Pad::GetGroup(GetPort(), PadGroup::Rumble))); | ||
|
||
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( | ||
CreateGroupBox(tr("C-Stick"), Pad::GetGroup(GetPort(), PadGroup::CStick))); | ||
m_main_layout->addWidget(CreateGroupBox(tr("D-Pad"), Pad::GetGroup(GetPort(), PadGroup::DPad))); | ||
m_main_layout->addItem(hbox_layout); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
void GCPadEmu::OnLoadProfile(const QString& profile) | ||
{ | ||
// TODO Implement this | ||
} | ||
|
||
void GCPadEmu::OnSaveProfile(const QString& profile) | ||
{ | ||
// TODO Implement this | ||
} | ||
|
||
void GCPadEmu::OnClearFields() | ||
{ | ||
// TODO Implement this | ||
} | ||
|
||
void GCPadEmu::OnDefaultFields() | ||
{ | ||
// TODO Implement this | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QCheckBox; | ||
class QFormLayout; | ||
class QGroupBox; | ||
class QHBoxLayout; | ||
class QLabel; | ||
class QVBoxLayout; | ||
|
||
class GCPadEmu final : public MappingWidget | ||
{ | ||
public: | ||
explicit GCPadEmu(MappingWindow* window); | ||
|
||
protected: | ||
void OnSaveProfile(const QString& profile) override; | ||
void OnLoadProfile(const QString& profile) override; | ||
void OnClearFields() override; | ||
void OnDefaultFields() override; | ||
|
||
private: | ||
void CreateButtonsLayout(); | ||
void CreateControlstickLayout(); | ||
void CreateCStickLayout(); | ||
void CreateTriggersLayout(); | ||
void CreateDPadLayout(); | ||
void CreateMainLayout(); | ||
void ConnectWidgets(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
|
||
// Buttons | ||
QGroupBox* m_buttons_box; | ||
QFormLayout* m_buttons_layout; | ||
// TODO Add missing settings | ||
|
||
// Control Stick | ||
QGroupBox* m_controlstick_box; | ||
QFormLayout* m_controlstick_layout; | ||
// TODO Add missing settings | ||
|
||
// C Stick | ||
QGroupBox* m_cstick_box; | ||
QFormLayout* m_cstick_layout; | ||
// TODO Add missing settings | ||
|
||
// Triggers | ||
QGroupBox* m_triggers_box; | ||
QFormLayout* m_triggers_layout; | ||
// TODO Add missing settings | ||
|
||
// D-Pad | ||
QGroupBox* m_dpad_box; | ||
QFormLayout* m_dpad_layout; | ||
// TODO Add missing settings | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include <QCheckBox> | ||
#include <QLabel> | ||
#include <QVBoxLayout> | ||
|
||
#include "DolphinQt2/Settings.h" | ||
#include "InputCommon/GCAdapter.h" | ||
|
||
#include "DolphinQt2/Config/Mapping/GCPadWiiU.h" | ||
|
||
GCPadWiiU::GCPadWiiU(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateLayout(); | ||
ConnectWidgets(); | ||
|
||
LoadSettings(); | ||
} | ||
|
||
void GCPadWiiU::CreateLayout() | ||
{ | ||
const bool detected = GCAdapter::IsDetected(); | ||
m_layout = new QVBoxLayout(); | ||
m_status_label = new QLabel(detected ? tr("Adapter Detected") : tr("No Adapter Detected")); | ||
m_rumble = new QCheckBox(tr("Enable Rumble")); | ||
m_simulate_bongos = new QCheckBox(tr("Simulate DK Bongos")); | ||
|
||
m_layout->addWidget(m_status_label); | ||
m_layout->addWidget(m_rumble); | ||
m_layout->addWidget(m_simulate_bongos); | ||
|
||
if (!detected) | ||
{ | ||
m_rumble->setEnabled(false); | ||
m_simulate_bongos->setEnabled(false); | ||
} | ||
|
||
setLayout(m_layout); | ||
} | ||
|
||
void GCPadWiiU::ConnectWidgets() | ||
{ | ||
connect(m_rumble, &QCheckBox::toggled, this, &GCPadWiiU::SaveSettings); | ||
connect(m_simulate_bongos, &QCheckBox::toggled, this, &GCPadWiiU::SaveSettings); | ||
} | ||
|
||
void GCPadWiiU::LoadSettings() | ||
{ | ||
m_rumble->setChecked(Settings().IsGCAdapterRumbleEnabled(GetPort())); | ||
m_simulate_bongos->setChecked(Settings().IsGCAdapterSimulatingDKBongos(GetPort())); | ||
} | ||
|
||
void GCPadWiiU::SaveSettings() | ||
{ | ||
Settings().SetGCAdapterRumbleEnabled(GetPort(), m_rumble->isChecked()); | ||
Settings().SetGCAdapterSimulatingDKBongos(GetPort(), m_simulate_bongos->isChecked()); | ||
} | ||
|
||
void GCPadWiiU::OnLoadProfile(const QString& profile) | ||
{ | ||
} | ||
|
||
void GCPadWiiU::OnSaveProfile(const QString& profile) | ||
{ | ||
} | ||
|
||
void GCPadWiiU::OnClearFields() | ||
{ | ||
} | ||
|
||
void GCPadWiiU::OnDefaultFields() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QCheckBox; | ||
class QLabel; | ||
class QVBoxLayout; | ||
|
||
class GCPadWiiU final : public MappingWidget | ||
{ | ||
public: | ||
explicit GCPadWiiU(MappingWindow* window); | ||
|
||
protected: | ||
void OnSaveProfile(const QString& profile) override; | ||
void OnLoadProfile(const QString& profile) override; | ||
void OnClearFields() override; | ||
void OnDefaultFields() override; | ||
|
||
private: | ||
void LoadSettings(); | ||
void SaveSettings(); | ||
void CreateLayout(); | ||
void ConnectWidgets(); | ||
|
||
QVBoxLayout* m_layout; | ||
QLabel* m_status_label; | ||
|
||
// Checkboxes | ||
QCheckBox* m_rumble; | ||
QCheckBox* m_simulate_bongos; | ||
}; |
Oops, something went wrong.