add option to hide name entry screen if course isn't in ranking list
This commit is contained in:
@@ -992,3 +992,16 @@ void Course::Info::GetAttackArray( AttackArray &out ) const
|
||||
|
||||
out.insert( out.end(), Attacks.begin(), Attacks.end() );
|
||||
}
|
||||
|
||||
bool Course::IsRanking() const
|
||||
{
|
||||
CStringArray rankingsongs;
|
||||
|
||||
split(THEME->GetMetric("ScreenRanking", "CoursesToShow"), ",", rankingsongs);
|
||||
|
||||
for(unsigned i=0; i < rankingsongs.size(); i++)
|
||||
if (rankingsongs[i].CompareNoCase(m_sPath))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -196,6 +196,7 @@ public:
|
||||
// sorting values
|
||||
int SortOrder_TotalDifficulty;
|
||||
int SortOrder_Ranking;
|
||||
bool IsRanking() const;
|
||||
|
||||
void UpdateCourseStats();
|
||||
|
||||
|
||||
@@ -133,6 +133,8 @@ PrefsManager::PrefsManager()
|
||||
m_bMoveRandomToEnd = false;
|
||||
m_iScoringType = SCORING_MAX2;
|
||||
|
||||
m_iGetRankingName = RANKING_ON;
|
||||
|
||||
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
|
||||
m_fMarathonVerSongSeconds = 60*5.f;
|
||||
|
||||
@@ -298,6 +300,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
|
||||
ini.GetValue( "Options", "LastSeenMemory", m_iLastSeenMemory );
|
||||
#endif
|
||||
ini.GetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
|
||||
ini.GetValue( "Options", "GetRankingName", (int&)m_iGetRankingName);
|
||||
ini.GetValue( "Options", "AntiAliasing", m_bAntiAliasing );
|
||||
ini.GetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
|
||||
ini.GetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
|
||||
@@ -424,6 +427,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
ini.SetValue( "Options", "LastSeenMemory", m_iLastSeenMemory );
|
||||
#endif
|
||||
ini.SetValue( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking );
|
||||
ini.SetValue( "Options", "GetRankingName", m_iGetRankingName);
|
||||
ini.SetValue( "Options", "AntiAliasing", m_bAntiAliasing );
|
||||
ini.SetValue( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
|
||||
ini.SetValue( "Options", "ForceLogFlush", m_bForceLogFlush );
|
||||
|
||||
@@ -118,6 +118,7 @@ public:
|
||||
// course ranking
|
||||
enum CourseSortOrders { COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK } m_iCourseSortOrder;
|
||||
bool m_bMoveRandomToEnd;
|
||||
enum GetRankingName { RANKING_OFF, RANKING_ON, RANKING_LIST } m_iGetRankingName;
|
||||
|
||||
// scoring type; SCORING_MAX2 should always be first
|
||||
enum ScoringTypes { SCORING_MAX2, SCORING_5TH } m_iScoringType;
|
||||
|
||||
@@ -149,6 +149,18 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
|
||||
return;
|
||||
}
|
||||
|
||||
bool IsOnRanking = ( (GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP || GAMESTATE->m_PlayMode == PLAY_MODE_ONI)
|
||||
&& !(GAMESTATE->m_pCurCourse->IsRanking()) );
|
||||
|
||||
if (PREFSMAN->m_iGetRankingName == PrefsManager::RANKING_OFF ||
|
||||
(PREFSMAN->m_iGetRankingName == PrefsManager::RANKING_LIST && !IsOnRanking))
|
||||
{
|
||||
// don't collect score due to ranking setting
|
||||
HandleScreenMessage( SM_GoToNextScreen );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GAMESTATE->m_bPastHereWeGo = true; // enable the gray arrows
|
||||
|
||||
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenNameEntry background") );
|
||||
|
||||
@@ -298,6 +298,12 @@ static void ShowSongOptions( int &sel, bool ToSel, const CStringArray &choices )
|
||||
MoveMap( sel, PREFSMAN->m_ShowSongOptions, ToSel, mapping, ARRAYSIZE(mapping) );
|
||||
}
|
||||
|
||||
static void ShowNameEntry( int &sel, bool ToSel, const CStringArray &choices )
|
||||
{
|
||||
const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST };
|
||||
MoveMap( sel, PREFSMAN->m_iGetRankingName, ToSel, mapping, ARRAYSIZE(mapping) );
|
||||
}
|
||||
|
||||
static void DefaultFailType( int &sel, bool ToSel, const CStringArray &choices )
|
||||
{
|
||||
if( ToSel )
|
||||
@@ -449,6 +455,7 @@ static const ConfOption g_ConfOptions[] =
|
||||
ConfOption( "Coins Per\nCredit", CoinsPerCredit, "1","2","3","4","5","6","7","8" ),
|
||||
ConfOption( "Joint\nPremium", JointPremium, "OFF","ON" ),
|
||||
ConfOption( "Show Song\nOptions", ShowSongOptions, "HIDE","SHOW","ASK" ),
|
||||
ConfOption( "Show Name\nEntry", ShowNameEntry, "OFF", "ON", "RANKING SONGS" ),
|
||||
|
||||
/* Graphic options */
|
||||
ConfOption( "Display\nMode", DisplayMode, "FULLSCREEN", "WINDOWED" ),
|
||||
|
||||
Reference in New Issue
Block a user