From de9c496399e25e1907a8ae69b5301d8145153869 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 12 Feb 2003 21:34:12 +0000 Subject: [PATCH] force NUM to the top and OTHER to the bottom of the ABC sort this is intuitively correct (numbers before letters and "other" at the end), and also looks somewhat symmetrical --- stepmania/src/MusicWheel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 109582243e..74d60736b1 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -276,8 +276,16 @@ struct CompareSongPointerArrayBySectionName CompareSongPointerArrayBySectionName( SongSortOrder so_ ): so(so_) { } bool operator() (const Song *p1, const Song *p2) const { - return MusicWheel::GetSectionNameFromSongAndSort( p1, so ) < - MusicWheel::GetSectionNameFromSongAndSort( p2, so ); + CString sec1 = MusicWheel::GetSectionNameFromSongAndSort( p1, so ); + CString sec2 = MusicWheel::GetSectionNameFromSongAndSort( p2, so ); + /* In the TITLE sort, make sure NUM comes first and OTHER comes last. */ + + if(so == SORT_TITLE && sec1 == "NUM" && sec2 != "NUM") return true; + if(so == SORT_TITLE && sec1 != "NUM" && sec2 == "NUM") return false; + if(so == SORT_TITLE && sec1 != "OTHER" && sec2 == "OTHER") return true; + if(so == SORT_TITLE && sec1 == "OTHER" && sec2 != "OTHER") return false; + + return sec1 < sec2; } };