From 4fb21aa137ba16e9794cf349c714c93a17d27e20 Mon Sep 17 00:00:00 2001 From: death2droid Date: Sun, 28 Mar 2010 09:51:57 +0000 Subject: [PATCH] Fix a problem with the sensitivity setting being grayed out when the wiimote wasn't set to emulated. Fix the problem with wiimote plugin not saving information correctly for the auto reconnect option. Fixes issue 2475 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5246 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/ConfigManager.cpp | 8 ++++++-- Source/Plugins/Plugin_Wiimote/Src/Config.cpp | 7 ++++++- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp | 10 +++++----- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 29deb8b5eb..4789851ce4 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -249,8 +249,12 @@ void SConfig::LoadSettings() ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default //Wiimote configs - ini.Get("Wiimote", "AutoReconnectRealWiimote", &m_WiiAutoReconnect, false); - + for (int i = 0; i < 4; i++) + { + char SectionName[32]; + sprintf(SectionName, "Wiimote%i", i + 1); + ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect, false); + } // Plugins ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str()); ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str()); diff --git a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp index 7bc16e6ab4..fcb95c4a83 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp @@ -447,7 +447,12 @@ void Config::Save() //Save any options that need to be accessed in Dolphin iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini").c_str()); - iniFile.Set("Wiimote" , "AutoReconnectRealWiimote", &WiiMoteEmu::WiiMapping[0].bWiiAutoReconnect); + for (int i = 0; i < MAX_WIIMOTES; i++) + { + char SectionName[32]; + sprintf(SectionName, "Wiimote%i", i + 1); + iniFile.Set(SectionName, "AutoReconnectRealWiimote", WiiMoteEmu::WiiMapping[i].bWiiAutoReconnect); + } iniFile.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini").c_str()); //DEBUG_LOG(WIIMOTE, "Save()"); diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp index 61bf588029..53f9dbe0e0 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp @@ -43,7 +43,7 @@ BEGIN_EVENT_TABLE(WiimoteBasicConfigDialog,wxDialog) EVT_CHECKBOX(IDC_UPRIGHTWIIMOTE, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_MOTIONPLUSCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged) EVT_CHECKBOX(IDC_WIIAUTORECONNECT, WiimoteBasicConfigDialog::GeneralSettingsChanged) - EVT_CHOICE(IDC_EXTCONNECTED, WiimoteBasicConfigDialog::GeneralSettingsChanged) + // IR cursor EVT_COMMAND_SCROLL(IDS_WIDTH, WiimoteBasicConfigDialog::IRCursorChanged) EVT_COMMAND_SCROLL(IDS_HEIGHT, WiimoteBasicConfigDialog::IRCursorChanged) @@ -177,8 +177,8 @@ void WiimoteBasicConfigDialog::CreateGUIControls() m_TextFoundRealWiimote[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Connected to 0 Real Wiimotes")); m_ConnectRealWiimote[i] = new wxButton(m_Controller[i], IDB_REFRESH_REAL, wxT("Refresh Real Wiimotes")); m_ConnectRealWiimote[i]->SetToolTip(wxT("This can only be done when the emulator is paused or stopped.")); - - m_WiiAutoReconnect[i] = new wxCheckBox(m_Controller[i], IDC_WIIAUTORECONNECT, wxT("Auto reconenct wiimote"), wxDefaultPosition, wxSize(-1, -1), 0, wxDefaultValidator); + + m_WiiAutoReconnect[i] = new wxCheckBox(m_Controller[i], IDC_WIIAUTORECONNECT, wxT("Auto reconnect wiimote")); m_WiiAutoReconnect[i]->SetToolTip(wxT("This makes dolphin automatically reconnect a wiimote when it has being disconnected.\nThis will cause problems when 2 controllers are connected for a 1 player game.")); //IR Pointer @@ -479,14 +479,14 @@ void WiimoteBasicConfigDialog::UpdateGUI() m_SidewaysWiimote[m_Page]->Enable(false); m_UprightWiimote[m_Page]->Enable(false); m_Extension[m_Page]->Enable(false); - m_SliderIrLevel[m_Page]->Enable(false); + m_SliderIrLevel[m_Page]->Enable(true); } else { m_SidewaysWiimote[m_Page]->Enable(true); m_UprightWiimote[m_Page]->Enable(true); m_Extension[m_Page]->Enable(true); - m_SliderIrLevel[m_Page]->Enable(true); + m_SliderIrLevel[m_Page]->Enable(false); } m_SidewaysWiimote[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].bSideways);