diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.h b/Source/Core/DolphinWX/ControllerConfigDiag.h index ea31226359..2f846d310e 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.h +++ b/Source/Core/DolphinWX/ControllerConfigDiag.h @@ -20,12 +20,14 @@ class ControllerConfigDiag : public wxDialog public: ControllerConfigDiag(wxWindow* const parent); +private: void RefreshRealWiimotes(wxCommandEvent& event); + void ConfigEmulatedWiimote(wxCommandEvent& event); + void SelectSource(wxCommandEvent& event); void RevertSource(); - void ConfigEmulatedWiimote(wxCommandEvent& event); void Save(wxCommandEvent& event); void OnSensorBarPos(wxCommandEvent& event) @@ -33,39 +35,44 @@ public: SConfig::GetInstance().m_SYSCONF->SetData("BT.BAR", event.GetInt()); event.Skip(); } + void OnSensorBarSensitivity(wxCommandEvent& event) { SConfig::GetInstance().m_SYSCONF->SetData("BT.SENS", event.GetInt()); event.Skip(); } + void OnSpeakerVolume(wxCommandEvent& event) { SConfig::GetInstance().m_SYSCONF->SetData("BT.SPKV", event.GetInt()); event.Skip(); } + void OnMotor(wxCommandEvent& event) { SConfig::GetInstance().m_SYSCONF->SetData("BT.MOT", event.GetInt()); event.Skip(); } + void OnContinuousScanning(wxCommandEvent& event) { SConfig::GetInstance().m_WiimoteContinuousScanning = event.IsChecked(); WiimoteReal::Initialize(); event.Skip(); } + void OnEnableSpeaker(wxCommandEvent& event) { SConfig::GetInstance().m_WiimoteEnableSpeaker = event.IsChecked(); event.Skip(); } + void OnGameCubeAdapter(wxCommandEvent& event) { SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked(); event.Skip(); } -private: wxStaticBoxSizer* CreateGamecubeSizer(); wxStaticBoxSizer* CreateWiimoteConfigSizer(); wxStaticBoxSizer* CreateBalanceBoardSizer(); diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp index 591287959d..0db723cfc8 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/InputConfigDiag.cpp @@ -216,6 +216,11 @@ void InputConfigDialog::ClickSave(wxCommandEvent& event) event.Skip(); } +int ControlDialog::GetRangeSliderValue() const +{ + return range_slider->GetValue(); +} + void ControlDialog::UpdateListContents() { control_lbox->Clear(); @@ -467,7 +472,7 @@ void GamepadPage::AdjustSettingUI(wxCommandEvent& event) void GamepadPage::AdjustControlOption(wxCommandEvent&) { - m_control_dialog->control_reference->range = (ControlState)(m_control_dialog->range_slider->GetValue()) / SLIDER_TICK_COUNT; + m_control_dialog->control_reference->range = (ControlState)(m_control_dialog->GetRangeSliderValue()) / SLIDER_TICK_COUNT; } void GamepadPage::ConfigControl(wxEvent& event) diff --git a/Source/Core/DolphinWX/InputConfigDiag.h b/Source/Core/DolphinWX/InputConfigDiag.h index d75fe45989..87dfe08a7c 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.h +++ b/Source/Core/DolphinWX/InputConfigDiag.h @@ -98,35 +98,37 @@ class ControlDialog : public wxDialog public: ControlDialog(GamepadPage* const parent, InputConfig& config, ControllerInterface::ControlReference* const ref); + bool Validate() override; + + int GetRangeSliderValue() const; + + ControllerInterface::ControlReference* const control_reference; + InputConfig& m_config; + +private: wxStaticBoxSizer* CreateControlChooser(GamepadPage* const parent); - virtual bool Validate() override; - - void DetectControl(wxCommandEvent& event); - void ClearControl(wxCommandEvent& event); - void SetDevice(wxCommandEvent& event); - void UpdateGUI(); void UpdateListContents(); void SelectControl(const std::string& name); + void DetectControl(wxCommandEvent& event); + void ClearControl(wxCommandEvent& event); + void SetDevice(wxCommandEvent& event); + void SetSelectedControl(wxCommandEvent& event); void AppendControl(wxCommandEvent& event); - ControllerInterface::ControlReference* const control_reference; - InputConfig& m_config; - wxComboBox* device_cbox; + bool GetExpressionForSelectedControl(wxString &expr); - wxTextCtrl* textctrl; - wxListBox* control_lbox; - wxSlider* range_slider; - -private: GamepadPage* const m_parent; + wxComboBox* device_cbox; + wxTextCtrl* textctrl; + wxListBox* control_lbox; + wxSlider* range_slider; wxStaticText* m_bound_label; wxStaticText* m_error_label; - ciface::Core::DeviceQualifier m_devq; - bool GetExpressionForSelectedControl(wxString &expr); + ciface::Core::DeviceQualifier m_devq; }; class ExtensionButton : public wxButton