Update Banner handling for new sorts

This commit is contained in:
Crash Cringle
2025-02-26 02:54:58 -05:00
committed by teejusb
parent b482c26612
commit c3886adb07
7 changed files with 36 additions and 15 deletions
@@ -0,0 +1 @@
Common fallback banner
@@ -0,0 +1 @@
Common fallback banner
+7 -1
View File
@@ -306,9 +306,13 @@ HardMeterText=Hard Meter
LengthText=Length
MediumMeterText=Medium Meter
PopularityText=Player's Best!
PopularityP1Text=P1's Most Played
PopularityP2Text=P2's Most Played
PreferredText=Preferred
TitleText=Title
RecentText=Recent
RecentText=Recently Played
RecentP1Text=P1's Recent Songs
RecentP2Text=P2's Recent Songs
TopGradesText=Top Grades
TopP1GradesText=P1 Top Grades
TopP2GradesText=P2 Top Grades
@@ -2039,6 +2043,8 @@ LowestGrades=Lowest Grades
MostPlays=Most Plays
Randomize=Randomize
TopGrades=Top Grades
RecentlyPlayed=Recently Played
MostPlayed=Most Played
[Sort]
NotAvailable=N/A
+5 -1
View File
@@ -965,13 +965,15 @@ RecentSongsToShow=30
UseEasyMarkerFlag=false
ModeMenuChoiceNames="Preferred,Group,Title,Bpm,Popularity,TopGrades,TopP1Grades,TopP2Grades,Artist,EasyMeter,MediumMeter,HardMeter,ChallengeMeter,DoubleEasyMeter,DoubleMediumMeter,DoubleHardMeter,DoubleChallengeMeter,Genre,Length,Recent"
ModeMenuChoiceNames="Preferred,Group,Title,Bpm,Popularity,PopularityP1,PopularityP2,TopGrades,TopP1Grades,TopP2Grades,Artist,EasyMeter,MediumMeter,HardMeter,ChallengeMeter,DoubleEasyMeter,DoubleMediumMeter,DoubleHardMeter,DoubleChallengeMeter,Genre,Length,Recent,RecentP1,RecentP2"
# ModeMenuChoiceNames="Preferred,Group,Title,Bpm,Popularity,TopGrades,Artist,EasyMeter,MediumMeter,HardMeter,ChallengeMeter,DoubleEasyMeter,DoubleMediumMeter,DoubleHardMeter,DoubleChallengeMeter,Genre,Length,Recent,NormalMode,BattleMode"
ChoicePreferred="sort,Preferred"
ChoiceGroup="sort,Group"
ChoiceTitle="sort,Title"
ChoiceBpm="sort,BPM"
ChoicePopularity="sort,Popularity"
ChoicePopularityP1="sort,PopularityP1"
ChoicePopularityP2="sort,PopularityP2"
ChoiceTopGrades="sort,TopGrades"
ChoiceTopP1Grades="sort,TopP1Grades"
ChoiceTopP2Grades="sort,TopP2Grades"
@@ -987,6 +989,8 @@ ChoiceDoubleHardMeter="sort,DoubleHardMeter"
ChoiceDoubleChallengeMeter="sort,DoubleChallengeMeter"
ChoiceLength="sort,Length"
ChoiceRecent="sort,Recent"
ChoiceRecentP1="sort,RecentP1"
ChoiceRecentP2="sort,RecentP2"
ChoiceNormalMode="playmode,regular"
ChoiceBattleMode="playmode,battle"
+19 -6
View File
@@ -228,14 +228,27 @@ void Banner::LoadRandom()
void Banner::LoadFromSortOrder( SortOrder so )
{
// TODO: See if the check for nullptr/PREFERRED(?) is needed.
if( so == SortOrder_Invalid )
switch( so )
{
LoadFallback();
}
else
{
if( so != SORT_GROUP && so != SORT_RECENT && so != SORT_RECENT_P1 && so != SORT_RECENT_P2 )
case SortOrder_Invalid:
LoadFallback();
break;
case SORT_GROUP:
break;
// This is necessary to prevent multiple banners from matching for SORT_RECENT and SORT_POPULARITY
case SORT_RECENT:
case SORT_RECENT_P1:
case SORT_RECENT_P2:
Load( THEME->GetPathG("Banner",ssprintf("%s",SortOrderToString(SORT_RECENT).c_str())) );
break;
case SORT_POPULARITY:
case SORT_POPULARITY_P1:
case SORT_POPULARITY_P2:
Load( THEME->GetPathG("Banner",ssprintf("%s",SortOrderToString(SORT_POPULARITY).c_str())) );
break;
default:
Load( THEME->GetPathG("Banner",ssprintf("%s",SortOrderToString(so).c_str())) );
break;
}
m_bScrolling = (bool)SCROLL_SORT_ORDER;
}
+2 -2
View File
@@ -625,7 +625,7 @@ void MusicWheel::BuildWheelItemDatas( std::vector<MusicWheelItemData *> &arrayWh
case SORT_POPULARITY:
if( (int) arraySongs.size() > MOST_PLAYED_SONGS_TO_SHOW )
arraySongs.erase( arraySongs.begin()+MOST_PLAYED_SONGS_TO_SHOW, arraySongs.end() );
bUseSections = false;
bUseSections = true;
break;
case SORT_POPULARITY_P1:
if( PROFILEMAN->IsPersistentProfile(PLAYER_1) )
@@ -666,7 +666,7 @@ void MusicWheel::BuildWheelItemDatas( std::vector<MusicWheelItemData *> &arrayWh
SongUtil::SortByMostRecentlyPlayedForMachine( arraySongs );
if( (int) arraySongs.size() > RECENT_SONGS_TO_SHOW )
arraySongs.erase( arraySongs.begin()+RECENT_SONGS_TO_SHOW, arraySongs.end() );
bUseSections = false;
bUseSections = true;
break;
case SORT_RECENT_P1:
if( PROFILEMAN->IsPersistentProfile(PLAYER_1) )
+1 -5
View File
@@ -642,9 +642,6 @@ void SongUtil::SortSongPointerArrayByNumPlays( std::vector<Song*> &vpSongsInOut,
g_mapSongSortVal.clear();
}
static LocalizedString SECTION_RECENTLY_PLAYED("SongSort", "Recently Played");
static LocalizedString SECTION_POPULAR_SONGS("SongSort", "Most Played");
RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so )
{
if( pSong == nullptr )
@@ -713,11 +710,10 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
case SORT_POPULARITY:
case SORT_POPULARITY_P1:
case SORT_POPULARITY_P2:
return SECTION_POPULAR_SONGS.GetValue();
case SORT_RECENT:
case SORT_RECENT_P1:
case SORT_RECENT_P2:
return SECTION_RECENTLY_PLAYED.GetValue();
return THEME->GetString("MusicWheel", ssprintf("%s%s", SortOrderToString(so).c_str(), "Text"));
case SORT_TOP_GRADES_P1:
{
int iCounts[NUM_Grade];