From dd364a2de95f327987dc51624d01db6ae1551a56 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 31 Mar 2005 02:57:51 +0000 Subject: [PATCH] use AddNumberSuffix --- stepmania/src/ScreenSelectMusic.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 20617409e8..9182411504 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -1567,23 +1567,7 @@ void ScreenSelectMusic::AfterMusicChange() const vector best = SONGMAN->GetBestSongs( PROFILE_SLOT_MACHINE ); const int index = FindIndex( best.begin(), best.end(), pSong ); if( index != -1 ) - { - CString sSuffix; - int iDisplay = index+1; - switch( iDisplay%10 ) - { - case 1: sSuffix = "st"; break; - case 2: sSuffix = "nd"; break; - case 3: sSuffix = "rd"; break; - default: sSuffix = "th"; break; - } - - // hack for teens: "11th", "113th", etc. - if( ((iDisplay%100) / 10) == 1 ) - sSuffix = "th"; - - m_MachineRank.SetText( ssprintf("%i", iDisplay) + sSuffix ); - } + m_MachineRank.SetText( AddNumberSuffix( index+1 ) ); m_DifficultyDisplay.SetDifficulties( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType ); @@ -1719,7 +1703,7 @@ void ScreenSelectMusic::AfterMusicChange() const vector best = SONGMAN->GetBestCourses( PROFILE_SLOT_MACHINE ); const int index = FindCourseIndexOfSameMode( best.begin(), best.end(), pCourse ); if( index != -1 ) - m_MachineRank.SetText( ssprintf("%i", index+1) ); + m_MachineRank.SetText( AddNumberSuffix( index+1 ) );