only AutoMap joysticks if joysticks attached to system change. This way, we won't override users' custom mappings as often.

This commit is contained in:
Chris Danford
2003-10-03 03:20:50 +00:00
parent 1c6b80dc91
commit 63fc85a7c4
6 changed files with 49 additions and 23 deletions
+25 -2
View File
@@ -219,8 +219,31 @@ void ResetGame( bool ReturnToFirstScreen )
PREFSMAN->m_bFirstRun = false;
if( PREFSMAN->m_bAutoMapJoysticks )
INPUTMAPPER->AutoMapJoysticksForCurrentGame();
//
// update last seen joysticks
//
vector<InputDevice> vDevices;
vector<CString> vDescriptions;
INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions);
vector<CString> vOldDescriptions;
split( PREFSMAN->m_sLastSeenInputDevices, ",", vOldDescriptions );
CString sInputDevices = join( ",", vDescriptions );
if( PREFSMAN->m_sLastSeenInputDevices != sInputDevices )
{
LOG->Info( "Input devices changed from '%s' to '%s'.", PREFSMAN->m_sLastSeenInputDevices.c_str(), sInputDevices.c_str() );
if( PREFSMAN->m_bAutoMapOnJoyChange )
{
LOG->Info( "Remapping joysticks." );
INPUTMAPPER->AutoMapJoysticksForCurrentGame();
}
PREFSMAN->m_sLastSeenInputDevices = sInputDevices;
}
if( ReturnToFirstScreen )
SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") );