Commit some work based off of James333's auto reconnect patch.

This still requires more work, like making the option only per Wiimote then rather the first one counting for them all.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5241 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
death2droid
2010-03-27 04:21:19 +00:00
parent b7f5582e64
commit 1a07772c8f
7 changed files with 60 additions and 18 deletions

View File

@ -248,16 +248,22 @@ void SConfig::LoadSettings()
ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default
//Wiimote configs
ini.Get("Wiimote", "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());
ini.Get("Core", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin[0], m_DefaultPADPlugin.c_str());
ini.Get("Core", "WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str());
}
m_SYSCONF = new SysConf();
}
// Is this still even needed????
void SConfig::LoadSettingsHLE()
{
IniFile ini;

View File

@ -44,6 +44,7 @@ struct SConfig
// Wii Devices
bool m_WiiSDCard;
bool m_WiiKeyboard;
bool m_WiiAutoReconnect;
// DSP HLE Audio fix
bool m_EnableRE0Fix;

View File

@ -173,21 +173,31 @@ CPanel::CPanel(
main_frame->bNoWiimoteMsg = false;
else
{
// The Wiimote has been disconnected, we offer reconnect here
wxMessageDialog *dlg = new wxMessageDialog(
this,
wxString::Format(wxT("Wiimote %i has been disconnected by system.\n")
wxT("Maybe this game doesn't support multi-wiimote,\n")
wxT("or maybe it is due to idle time out or other reason.\n\n")
wxT("Do you want to reconnect immediately?"), lParam + 1),
wxT("Reconnect Wiimote Confirm"),
wxYES_NO | wxSTAY_ON_TOP | wxICON_INFORMATION, //wxICON_QUESTION,
wxDefaultPosition);
if (dlg->ShowModal() == wxID_YES)
//Auto reconnect if option is turned on.
//TODO: Make this only auto reconnect wiimotes that have the option activated.
if (SConfig::GetInstance().m_WiiAutoReconnect)
{
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
NOTICE_LOG(WIIMOTE, "Wiimote %i has been auto-reconnected...", lParam + 1);
}
else
{
// The Wiimote has been disconnected, we offer reconnect here.
wxMessageDialog *dlg = new wxMessageDialog(
this,
wxString::Format(wxT("Wiimote %i has been disconnected by system.\n")
wxT("Maybe this game doesn't support multi-wiimote,\n")
wxT("or maybe it is due to idle time out or other reason.\n\n")
wxT("Do you want to reconnect immediately?"), lParam + 1),
wxT("Reconnect Wiimote Confirm"),
wxYES_NO | wxSTAY_ON_TOP | wxICON_INFORMATION, //wxICON_QUESTION,
wxDefaultPosition);
dlg->Destroy();
if (dlg->ShowModal() == wxID_YES)
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
dlg->Destroy();
}
}
}
}