diff options
| author | skidau <skidau@gmail.com> | 2014-12-13 12:06:17 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2014-12-13 12:06:17 +1100 |
| commit | 297ef16745c4eb64265460ebbe1bd3e493f6fdef (patch) | |
| tree | e7358a4d2e60987b2efb1c016f1cd41c55ea4e0e /Source/Core/DolphinWX/ControllerConfigDiag.cpp | |
| parent | 7ebca647b348000db2169dbbf4f873a5bd07a25b (diff) | |
| parent | 30b34f3b2edf5785b3c205882064ed55c281807a (diff) | |
Merge pull request #1678 from skidau/GC-Adapter
Added GameCube Adapter support
Diffstat (limited to 'Source/Core/DolphinWX/ControllerConfigDiag.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/ControllerConfigDiag.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index da7cc6145a..f1a36c7efa 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -27,6 +27,9 @@ #include "Core/NetPlayProto.h" #include "Core/HW/GCPad.h" #include "Core/HW/SI.h" +#if defined(__LIBUSB__) || defined (_WIN32) +#include "Core/HW/SI_GCAdapter.h" +#endif #include "Core/HW/Wiimote.h" #include "Core/HW/WiimoteReal/WiimoteReal.h" #include "DolphinWX/ControllerConfigDiag.h" @@ -68,7 +71,7 @@ ControllerConfigDiag::ControllerConfigDiag(wxWindow* const parent) wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer() { - wxStaticBoxSizer* const gamecube_static_sizer = new wxStaticBoxSizer(wxHORIZONTAL, this, _("GameCube Controllers")); + wxStaticBoxSizer* const gamecube_static_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("GameCube Controllers")); wxFlexGridSizer* const gamecube_flex_sizer = new wxFlexGridSizer(3, 5, 5); wxStaticText* pad_labels[4]; @@ -134,6 +137,36 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer() } gamecube_static_sizer->Add(gamecube_flex_sizer, 1, wxEXPAND, 5); + gamecube_static_sizer->AddSpacer(5); + + wxStaticBoxSizer* const gamecube_adapter_group = new wxStaticBoxSizer(wxHORIZONTAL, this, _("GameCube Adapter")); + wxBoxSizer* const gamecube_adapter_sizer = new wxBoxSizer(wxHORIZONTAL); + + wxCheckBox* const gamecube_adapter = new wxCheckBox(this, wxID_ANY, _("Direct Connect")); + gamecube_adapter->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnGameCubeAdapter, this); + + gamecube_adapter_sizer->Add(gamecube_adapter, 0, wxEXPAND); + gamecube_adapter_group->Add(gamecube_adapter_sizer, 0, wxEXPAND); + gamecube_static_sizer->Add(gamecube_adapter_group, 0, wxEXPAND); + +#if defined(__LIBUSB__) || defined (_WIN32) + if (!SI_GCAdapter::IsDetected()) + { + if (!SI_GCAdapter::IsDriverDetected()) + gamecube_adapter->SetLabelText(_("Driver Not Detected")); + else + gamecube_adapter->SetLabelText(_("Adapter Not Detected")); + gamecube_adapter->SetValue(false); + gamecube_adapter->Disable(); + } + else + { + gamecube_adapter->SetValue(SConfig::GetInstance().m_GameCubeAdapter); + if (Core::GetState() != Core::CORE_UNINITIALIZED) + gamecube_adapter->Disable(); + } +#endif + return gamecube_static_sizer; } |
