ugly hack to fix "mem card name not updated if card left in between games"
This commit is contained in:
@@ -261,7 +261,7 @@ match:
|
||||
|
||||
void MemoryCardManager::FlushAllDisks()
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( m_Device[p].IsBlank() ) // no card assigned
|
||||
continue; // skip
|
||||
@@ -285,3 +285,22 @@ CString MemoryCardManager::GetName( PlayerNumber pn ) const
|
||||
{
|
||||
return m_Device[pn].sName;
|
||||
}
|
||||
|
||||
void MemoryCardManager::RefreshNames()
|
||||
{
|
||||
// HACK: UsbStorageDevice::sName is only read when the device is connected.
|
||||
// If the player leaves their memory card in after the game ends and they
|
||||
// immediate start another game, then sName isn't re-read automatically.
|
||||
// It's much harder to add logic to read the name again to MemoryCardDriver
|
||||
// than to add a small hack here.
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( m_Device[p].IsBlank() ) // no card assigned
|
||||
continue; // skip
|
||||
if( m_bWriteError[p] || m_bTooLate[p] )
|
||||
continue; // skip
|
||||
CString sProfileDir = MEM_CARD_MOUNT_POINT[p] + PREFSMAN->m_sMemoryCardProfileSubdir + '/';
|
||||
m_Device[p].sName = Profile::GetProfileDisplayNameFromDir( sProfileDir );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user