diff --git a/stepmania/src/ScreenOptionsMemoryCard.cpp b/stepmania/src/ScreenOptionsMemoryCard.cpp index bb0855a0f9..d343eb78c2 100644 --- a/stepmania/src/ScreenOptionsMemoryCard.cpp +++ b/stepmania/src/ScreenOptionsMemoryCard.cpp @@ -99,7 +99,27 @@ void ScreenOptionsMemoryCard::HandleMessage( const RString& sMessage ) if( sMessage == MessageToString(Message_StorageDevicesChanged) ) { if( !m_Out.IsTransitioning() ) - SCREENMAN->SetNewScreen( this->m_sName ); // reload + { + /* Remember the old mountpoint. */ + const vector &v = m_CurrentUsbStorageDevices; + int iRow = m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber]; + RString sOldMountPoint; + if( iRow < int(v.size()) ) + { + const UsbStorageDevice &dev = v[iRow]; + sOldMountPoint = dev.sOsMountDir; + } + + /* If the devices that we'd actually show havn't changed, don't recreate the menu. */ + if( !UpdateCurrentUsbStorageDevices() ) + return; + + CreateMenu(); + RestartOptions(); + + /* If the memory card that was selected previously is still there, select it. */ + SelectRowWithMemoryCard( sOldMountPoint ); + } } }