Don't fill in new Profiles with a hard-coded "NoName". Let ScreenSystemLayer fill in blank name from metrics.
This commit is contained in:
@@ -156,7 +156,7 @@ CString Profile::GetDisplayName() const
|
|||||||
else if( !m_sLastUsedHighScoreName.empty() )
|
else if( !m_sLastUsedHighScoreName.empty() )
|
||||||
return m_sLastUsedHighScoreName;
|
return m_sLastUsedHighScoreName;
|
||||||
else
|
else
|
||||||
return "NoName";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static CString FormatCalories( float fCals )
|
static CString FormatCalories( float fCals )
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ private:
|
|||||||
|
|
||||||
bool m_bWasLoadedFromMemoryCard[NUM_PLAYERS];
|
bool m_bWasLoadedFromMemoryCard[NUM_PLAYERS];
|
||||||
bool m_bLastLoadWasTamperedOrCorrupt[NUM_PLAYERS]; // true if Stats.xml was present, but failed to load (probably because of a signature failure)
|
bool m_bLastLoadWasTamperedOrCorrupt[NUM_PLAYERS]; // true if Stats.xml was present, but failed to load (probably because of a signature failure)
|
||||||
bool m_bLastLoadWasFromLastGood[NUM_PLAYERS];
|
bool m_bLastLoadWasFromLastGood[NUM_PLAYERS]; // if true, then m_bLastLoadWasTamperedOrCorrupt is also true
|
||||||
|
|
||||||
// actual loaded profile data
|
// actual loaded profile data
|
||||||
Profile m_Profile[NUM_PLAYERS];
|
Profile m_Profile[NUM_PLAYERS];
|
||||||
|
|||||||
@@ -150,20 +150,28 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const
|
|||||||
case MEMORY_CARD_STATE_CHECKING: return CREDITS_CARD_CHECKING.GetValue();
|
case MEMORY_CARD_STATE_CHECKING: return CREDITS_CARD_CHECKING.GetValue();
|
||||||
case MEMORY_CARD_STATE_REMOVED: return CREDITS_CARD_REMOVED.GetValue();
|
case MEMORY_CARD_STATE_REMOVED: return CREDITS_CARD_REMOVED.GetValue();
|
||||||
case MEMORY_CARD_STATE_READY:
|
case MEMORY_CARD_STATE_READY:
|
||||||
if( PROFILEMAN->LastLoadWasFromLastGood(pn) && pProfile )
|
{
|
||||||
return pProfile->GetDisplayName() + CREDITS_LOADED_FROM_LAST_GOOD_APPEND.GetValue();
|
// If the profile failed to load and there was no usable backup...
|
||||||
else if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) )
|
if( PROFILEMAN->LastLoadWasTamperedOrCorrupt(pn) && !PROFILEMAN->LastLoadWasFromLastGood(pn) )
|
||||||
return CREDITS_LOAD_FAILED.GetValue();
|
return CREDITS_LOAD_FAILED.GetValue();
|
||||||
// Prefer the name of the profile over the name of the card.
|
|
||||||
else if( pProfile )
|
|
||||||
return pProfile->GetDisplayName();
|
|
||||||
else if( !MEMCARDMAN->IsNameAvailable(pn) )
|
|
||||||
return CREDITS_CARD_READY.GetValue();
|
|
||||||
else if( !MEMCARDMAN->GetName(pn).empty() )
|
|
||||||
return MEMCARDMAN->GetName(pn);
|
|
||||||
else
|
|
||||||
return CREDITS_CARD_NO_NAME.GetValue();
|
|
||||||
|
|
||||||
|
// If there is a local profile loaded, prefer it over the name of the memory card.
|
||||||
|
if( pProfile )
|
||||||
|
{
|
||||||
|
CString s = pProfile->GetDisplayName();
|
||||||
|
if( s.empty() )
|
||||||
|
s = CREDITS_CARD_NO_NAME.GetValue();
|
||||||
|
if( PROFILEMAN->LastLoadWasFromLastGood(pn) )
|
||||||
|
s += CREDITS_LOADED_FROM_LAST_GOOD_APPEND.GetValue();
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
else if( !MEMCARDMAN->IsNameAvailable(pn) )
|
||||||
|
return CREDITS_CARD_READY.GetValue();
|
||||||
|
else if( !MEMCARDMAN->GetName(pn).empty() )
|
||||||
|
return MEMCARDMAN->GetName(pn);
|
||||||
|
else
|
||||||
|
return CREDITS_CARD_NO_NAME.GetValue();
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
FAIL_M( ssprintf("%i",mcs) );
|
FAIL_M( ssprintf("%i",mcs) );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user