From 3275bfd581a2e0948efac04573613c7879d89c26 Mon Sep 17 00:00:00 2001 From: Sean Burke Date: Tue, 9 Sep 2003 02:54:34 +0000 Subject: [PATCH] Allow a manually set pref for what courses to display in ScreenRanking. --- stepmania/src/PrefsManager.cpp | 336 ++++++++++++++++---------------- stepmania/src/PrefsManager.h | 2 + stepmania/src/ScreenRanking.cpp | 5 +- 3 files changed, 176 insertions(+), 167 deletions(-) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 57cc329216..97d1745778 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -162,6 +162,8 @@ PrefsManager::PrefsManager() m_bThreadedInput = true; m_sIgnoredMessageWindows = ""; + m_sCoursesToShowRanking = ""; + ReadGlobalPrefsFromDisk( true ); } @@ -176,112 +178,113 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame ) if( !ini.ReadFile() ) return; // could not read config file, load nothing - ini.GetValueB( "Options", "Windowed", m_bWindowed ); - ini.GetValueB( "Options", "Interlaced", m_bInterlaced ); + ini.GetValueB( "Options", "Windowed", m_bWindowed ); + ini.GetValueB( "Options", "Interlaced", m_bInterlaced ); #ifdef _XBOX - ini.GetValueB( "Options", "PAL", m_bPAL ); + ini.GetValueB( "Options", "PAL", m_bPAL ); #endif - ini.GetValueI( "Options", "DisplayWidth", m_iDisplayWidth ); - ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight ); - ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth ); - ini.GetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth ); - ini.GetValueI( "Options", "MovieColorDepth", m_iMovieColorDepth ); - ini.GetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution ); - ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate ); - ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes ); + ini.GetValueI( "Options", "DisplayWidth", m_iDisplayWidth ); + ini.GetValueI( "Options", "DisplayHeight", m_iDisplayHeight ); + ini.GetValueI( "Options", "DisplayColorDepth", m_iDisplayColorDepth ); + ini.GetValueI( "Options", "TextureColorDepth", m_iTextureColorDepth ); + ini.GetValueI( "Options", "MovieColorDepth", m_iMovieColorDepth ); + ini.GetValueI( "Options", "MaxTextureResolution", m_iMaxTextureResolution ); + ini.GetValueI( "Options", "RefreshRate", m_iRefreshRate ); + ini.GetValueB( "Options", "IgnoreJoyAxes", m_bIgnoreJoyAxes ); ini.GetValueB( "Options", "UseDedicatedMenuButtons", m_bOnlyDedicatedMenuButtons ); - ini.GetValueB( "Options", "ShowStats", m_bShowStats ); - ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode ); - ini.GetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds); - ini.GetValueB( "Options", "ShowDanger", m_bShowDanger ); - ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness ); - ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer ); - ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages ); - ini.GetValueB( "Options", "EventMode", m_bEventMode ); - ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay ); - ini.GetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); + ini.GetValueB( "Options", "ShowStats", m_bShowStats ); + ini.GetValueI( "Options", "BackgroundMode", (int&)m_BackgroundMode ); + ini.GetValueI( "Options", "NumBackgrounds", m_iNumBackgrounds); + ini.GetValueB( "Options", "ShowDanger", m_bShowDanger ); + ini.GetValueF( "Options", "BGBrightness", m_fBGBrightness ); + ini.GetValueB( "Options", "MenuTimer", m_bMenuTimer ); + ini.GetValueI( "Options", "NumArcadeStages", m_iNumArcadeStages ); + ini.GetValueB( "Options", "EventMode", m_bEventMode ); + ini.GetValueB( "Options", "AutoPlay", m_bAutoPlay ); + ini.GetValueF( "Options", "JudgeWindowScale", m_fJudgeWindowScale ); ini.GetValueF( "Options", "JudgeWindowMarvelousSeconds", m_fJudgeWindowMarvelousSeconds ); ini.GetValueF( "Options", "JudgeWindowPerfectSeconds", m_fJudgeWindowPerfectSeconds ); ini.GetValueF( "Options", "JudgeWindowGreatSeconds", m_fJudgeWindowGreatSeconds ); - ini.GetValueF( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds ); - ini.GetValueF( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); - ini.GetValueF( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); - ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); - ini.GetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS ); - ini.GetValueB( "Options", "DelayedEscape", m_bDelayedEscape ); - ini.GetValueB( "Options", "HiddenSongs", m_bHiddenSongs ); - ini.GetValueB( "Options", "Vsync", m_bVsync ); - ini.GetValueB( "Options", "HowToPlay", m_bInstructions ); - ini.GetValueB( "Options", "Caution", m_bShowDontDie ); - ini.GetValueB( "Options", "ShowSelectGroup", m_bShowSelectGroup ); - ini.GetValueB( "Options", "ShowNative", m_bShowNative ); + ini.GetValueF( "Options", "JudgeWindowGoodSeconds", m_fJudgeWindowGoodSeconds ); + ini.GetValueF( "Options", "JudgeWindowBooSeconds", m_fJudgeWindowBooSeconds ); + ini.GetValueF( "Options", "JudgeWindowOKSeconds", m_fJudgeWindowOKSeconds ); + ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale ); + ini.GetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS ); + ini.GetValueB( "Options", "DelayedEscape", m_bDelayedEscape ); + ini.GetValueB( "Options", "HiddenSongs", m_bHiddenSongs ); + ini.GetValueB( "Options", "Vsync", m_bVsync ); + ini.GetValueB( "Options", "HowToPlay", m_bInstructions ); + ini.GetValueB( "Options", "Caution", m_bShowDontDie ); + ini.GetValueB( "Options", "ShowSelectGroup", m_bShowSelectGroup ); + ini.GetValueB( "Options", "ShowNative", m_bShowNative ); ini.GetValueB( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation ); - ini.GetValue ( "Options", "DWIPath", m_DWIPath ); - ini.GetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); - ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); - ini.GetValueB( "Options", "BannerCache", m_bBannerCache ); - ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); - ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); - ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); - ini.GetValue ( "Options", "MovieDrivers", m_sMovieDrivers ); - ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); - ini.GetValueI( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming ); - ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); - ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); - ini.GetValueI( "Options", "CoinMode", m_iCoinMode ); - ini.GetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); - ini.GetValueB( "Options", "JointPremium", m_bJointPremium ); - ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority ); - ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage ); - ini.GetValueB( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs ); - ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); - ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); - ini.GetValueI( "Options", "ShowSongOptions", (int&)m_ShowSongOptions ); + ini.GetValue ( "Options", "DWIPath", m_DWIPath ); + ini.GetValueB( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete ); + ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad ); + ini.GetValueB( "Options", "BannerCache", m_bBannerCache ); + ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections ); + ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed ); + ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers ); + ini.GetValue ( "Options", "MovieDrivers", m_sMovieDrivers ); + ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs ); + ini.GetValueI( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming ); + ini.GetValueF( "Options", "SoundVolume", m_fSoundVolume ); + ini.GetValueB( "Options", "SoundPreloadAll", m_bSoundPreloadAll ); + ini.GetValueI( "Options", "CoinMode", m_iCoinMode ); + ini.GetValueI( "Options", "CoinsPerCredit", m_iCoinsPerCredit ); + ini.GetValueB( "Options", "JointPremium", m_bJointPremium ); + ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority ); + ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage ); + ini.GetValueB( "Options", "ComboContinuesBetweenSongs", m_bComboContinuesBetweenSongs ); + ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds ); + ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds ); + ini.GetValueI( "Options", "ShowSongOptions", (int&)m_ShowSongOptions ); ini.GetValueB( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer ); - ini.GetValueB( "Options", "ThreadedInput", m_bThreadedInput ); - ini.GetValue ( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); - ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle ); - ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni ); - ini.GetValueB( "Options", "ShowLyrics", m_bShowLyrics ); - ini.GetValueB( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes ); - ini.GetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); - ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); - ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); - ini.GetValueI( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters ); - ini.GetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed ); + ini.GetValueB( "Options", "ThreadedInput", m_bThreadedInput ); + ini.GetValue ( "Options", "IgnoredMessageWindows", m_sIgnoredMessageWindows ); + ini.GetValueB( "Options", "SoloSingle", m_bSoloSingle ); + ini.GetValueB( "Options", "DancePointsForOni", m_bDancePointsForOni ); + ini.GetValueB( "Options", "ShowLyrics", m_bShowLyrics ); + ini.GetValueB( "Options", "AutogenMissingTypes", m_bAutogenMissingTypes ); + ini.GetValueB( "Options", "AutogenGroupCourses", m_bAutogenGroupCourses ); + ini.GetValueB( "Options", "Timestamping", m_bTimestamping ); + ini.GetValueB( "Options", "BreakComboToGetItem", m_bBreakComboToGetItem ); + ini.GetValueI( "Options", "ShowDancingCharacters", (int&)m_ShowDancingCharacters ); + ini.GetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed ); - ini.GetValueI( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder ); - ini.GetValueB( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd ); + ini.GetValueI( "Options", "CourseSortOrder", (int&)m_iCourseSortOrder ); + ini.GetValueB( "Options", "MoveRandomToEnd", m_bMoveRandomToEnd ); - ini.GetValueI( "Options", "ScoringType", (int&)m_iScoringType ); + ini.GetValueI( "Options", "ScoringType", (int&)m_iScoringType ); - ini.GetValueI( "Options", "ProgressiveLifebar", (int&)m_iProgressiveLifebar ); - ini.GetValueI( "Options", "ProgressiveNonstopLifebar", (int&)m_iProgressiveNonstopLifebar ); + ini.GetValueI( "Options", "ProgressiveLifebar", (int&)m_iProgressiveLifebar ); + ini.GetValueI( "Options", "ProgressiveNonstopLifebar", (int&)m_iProgressiveNonstopLifebar ); ini.GetValueI( "Options", "ProgressiveStageLifebar", (int&)m_iProgressiveStageLifebar ); - ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); + ini.GetValueB( "Options", "UseUnlockSystem", m_bUseUnlockSystem ); - ini.GetValueB( "Options", "FirstRun", m_bFirstRun ); - ini.GetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); - ini.GetValue ( "Options", "VideoRenderers", m_sVideoRenderers ); - ini.GetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver ); + ini.GetValueB( "Options", "FirstRun", m_bFirstRun ); + ini.GetValueB( "Options", "AutoMapJoysticks", m_bAutoMapJoysticks ); + ini.GetValue ( "Options", "VideoRenderers", m_sVideoRenderers ); + ini.GetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver ); #if defined(WIN32) - ini.GetValue ( "Options", "LastSeenMemory", m_iLastSeenMemory ); + ini.GetValue ( "Options", "LastSeenMemory", m_iLastSeenMemory ); #endif - ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); - ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); - ini.GetValueB( "Options", "ForceLogFlush", m_bForceLogFlush ); - ini.GetValueB( "Options", "Logging", m_bLogging ); - ini.GetValueB( "Options", "ShowLogWindow", m_bShowLogWindow ); - ini.GetValueB( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper ); - ini.GetValue ( "Options", "Language", m_sLanguage ); + ini.GetValue ( "Options", "CoursesToShowRanking", m_sCoursesToShowRanking ); + ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); + ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); + ini.GetValueB( "Options", "ForceLogFlush", m_bForceLogFlush ); + ini.GetValueB( "Options", "Logging", m_bLogging ); + ini.GetValueB( "Options", "ShowLogWindow", m_bShowLogWindow ); + ini.GetValueB( "Options", "ShowBeginnerHelper", m_bShowBeginnerHelper ); + ini.GetValue ( "Options", "Language", m_sLanguage ); for( int p=0; pGetMetricF("ScreenRanking","TimeStartY") #define SECONDS_PER_PAGE THEME->GetMetricF("ScreenRanking","SecondsPerPage") #define SHOW_CATEGORIES THEME->GetMetricB("ScreenRanking","ShowCategories") -#define COURSES_TO_SHOW THEME->GetMetric("ScreenRanking","CoursesToShow") #define NOTES_TYPES_TO_HIDE THEME->GetMetric ("ScreenRanking","NotesTypesToHide") +#define COURSES_TO_SHOW PREFSMAN->m_sCoursesToShowRanking const ScreenMessage SM_ShowNextPage = (ScreenMessage)(SM_User+67); const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68); @@ -96,6 +96,9 @@ ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking") m_textTime[i].SetZoom( TEXT_ZOOM ); m_textTime[i].SetHorizAlign( Actor::align_right ); this->AddChild( &m_textTime[i] ); + + if( PREFSMAN->m_sCoursesToShowRanking == "" ) + m_sCoursesToShowRanking = THEME->GetMetric("ScreenRanking","CoursesToShow"); }