From 229aa2cae986c3970cac0b876bec98d9cea1437d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 26 Jan 2003 21:45:13 +0000 Subject: [PATCH] fixed ThemeManager using element in base theme instead of current theme if base theme has a redir, simplifed a few sound element names. --- stepmania/src/ScreenEz2SelectMusic.cpp | 6 +-- stepmania/src/ScreenRanking.cpp | 22 ++++++----- stepmania/src/ScreenSelectMusic.cpp | 6 +-- stepmania/src/StepMania.dsp | 32 ++++++++++------ stepmania/src/ThemeManager.cpp | 52 +++++++++----------------- stepmania/src/ThemeManager.h | 2 +- 6 files changed, 57 insertions(+), 63 deletions(-) diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index be153d69ae..5f0387353e 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -76,8 +76,8 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() ); this->AddChild( &m_Menu ); - m_soundMusicChange.Load( THEME->GetPathTo("Sounds","select music change song")); - m_soundMusicCycle.Load( THEME->GetPathTo("Sounds","select music cycle songs")); + m_soundMusicChange.Load( THEME->GetPathTo("Sounds","select music change")); + m_soundMusicCycle.Load( THEME->GetPathTo("Sounds","select music cycle")); m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_ChoiceListFrame.Load( THEME->GetPathTo("Graphics","select mode list frame")); @@ -157,7 +157,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); this->AddChild( &m_sprOptionsMessage ); - m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music change options") ); + m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music options") ); m_bGoToOptions = false; m_bMadeChoice = false; diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 2fc968d017..c6ffa906f3 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -116,18 +116,20 @@ ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking","ranking") } } - vector asCoursePaths; - split( COURSES_TO_SHOW, ",", asCoursePaths, true ); - for( unsigned i=0; i asCoursePaths; + split( COURSES_TO_SHOW, ",", asCoursePaths, true ); + for( unsigned i=0; iGetCourseFromPath( asCoursePaths[c] ); - if( pts.pCourse ) - m_vPagesToShow.push_back( pts ); + for( unsigned c=0; cGetCourseFromPath( asCoursePaths[c] ); + if( pts.pCourse ) + m_vPagesToShow.push_back( pts ); + } } } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 6f402f35a5..a20bf5f16b 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -228,9 +228,9 @@ ScreenSelectMusic::ScreenSelectMusic() m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); - m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music change notes") ); - m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music change options") ); - m_soundLocked.Load( THEME->GetPathTo("Sounds","select music wheel locked") ); + m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music notes") ); + m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music options") ); + m_soundLocked.Load( THEME->GetPathTo("Sounds","select music locked") ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music intro") ); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 6dba3c25b0..312346c839 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -57,10 +57,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /pdb:none # Begin Special Build Tool IntDir=.\../Release6 -TargetDir=\Stepmania\stepmania +TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -92,10 +92,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\Stepmania\stepmania +TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -1473,14 +1473,6 @@ SOURCE=.\ScreenGraphicOptions.h # End Source File # Begin Source File -SOURCE=.\ScreenHighScores.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScreenHighScores.h -# End Source File -# Begin Source File - SOURCE=.\ScreenHowToPlay.h # End Source File # Begin Source File @@ -1549,6 +1541,14 @@ SOURCE=.\ScreenMusicScroll.h # End Source File # Begin Source File +SOURCE=.\ScreenNameEntry.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScreenNameEntry.h +# End Source File +# Begin Source File + SOURCE=.\ScreenOptions.cpp # End Source File # Begin Source File @@ -1573,6 +1573,14 @@ SOURCE=.\ScreenPrompt.h # End Source File # Begin Source File +SOURCE=.\ScreenRanking.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScreenRanking.h +# End Source File +# Begin Source File + SOURCE=.\ScreenSandbox.cpp # End Source File # Begin Source File diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 566189f912..7f24ca68fa 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -116,29 +116,21 @@ CString ThemeManager::GetThemeDirFromName( const CString &sThemeName ) return THEMES_DIR + sThemeName + "\\"; } -CString ThemeManager::GetPathToOptional( CString sAssetCategory, CString sFileName ) +CString ThemeManager::GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName ) { try_element_again: sAssetCategory.MakeLower(); sFileName.MakeLower(); - const CString sCurrentThemeDir = GetThemeDirFromName( m_sCurThemeName ); - const CString sDefaultThemeDir = GetThemeDirFromName( BASE_THEME_NAME ); + const CString sThemeDir = GetThemeDirFromName( sThemeName ); CStringArray asPossibleElementFilePaths; - /////////////////////////////////////// - // Search both the current theme and the default theme dirs for this element - /////////////////////////////////////// - /* First, look for redirs. */ - GetDirListing( sCurrentThemeDir + sAssetCategory+"/"+sFileName + ".redir", - asPossibleElementFilePaths, false, true ); - if(asPossibleElementFilePaths.empty()) - GetDirListing( sDefaultThemeDir + sAssetCategory+"/"+sFileName + ".redir", + GetDirListing( sThemeDir + sAssetCategory+"/"+sFileName + ".redir", asPossibleElementFilePaths, false, true ); - if( !asPossibleElementFilePaths.empty() && asPossibleElementFilePaths[0].GetLength() > 5 && asPossibleElementFilePaths[0].Right(5) == "redir" ) // this is a redirect file + if( !asPossibleElementFilePaths.empty() ) // this is a redirect file { CString sNewFilePath = DerefRedir(asPossibleElementFilePaths[0]); @@ -200,32 +192,26 @@ try_element_again: if( sAssetCategory == "bganimations" ) DirsOnly=true; - int i; - for(i = 0; asset_masks[i]; ++i) - { - GetDirListing( sCurrentThemeDir + sAssetCategory+"/" + sFileName + asset_masks[i], + for(int i = 0; asset_masks[i]; ++i) + GetDirListing( sThemeDir + sAssetCategory+"/" + sFileName + asset_masks[i], asPossibleElementFilePaths, DirsOnly, true ); - } if( sAssetCategory == "fonts" ) Font::WeedFontNames(asPossibleElementFilePaths, sFileName); - if(asPossibleElementFilePaths.empty()) - { - for(i = 0; asset_masks[i]; ++i) - { - GetDirListing( sDefaultThemeDir + sAssetCategory+"/" + sFileName + asset_masks[i], - asPossibleElementFilePaths, DirsOnly, true ); - } - - if( sAssetCategory == "fonts" ) - Font::WeedFontNames(asPossibleElementFilePaths, sFileName); - } - if(asPossibleElementFilePaths.empty()) return ""; + else + return asPossibleElementFilePaths[0]; +} - return asPossibleElementFilePaths[0]; +CString ThemeManager::GetPathToOptional( CString sAssetCategory, CString sFileName ) +{ + CString ret = GetPathTo( m_sCurThemeName, sAssetCategory, sFileName); + if( !ret.empty() ) // we found something + return ret; + ret = GetPathTo( BASE_THEME_NAME, sAssetCategory, sFileName); + return ret; } CString ThemeManager::GetPathTo( CString sAssetCategory, CString sFileName ) @@ -234,10 +220,8 @@ CString ThemeManager::GetPathTo( CString sAssetCategory, CString sFileName ) try_element_again: #endif - CString ret = GetPathToOptional(sAssetCategory, sFileName); - - /* If it's empty, we found nothing. */ - if( !ret.empty() ) + CString ret = GetPathToOptional( sAssetCategory, sFileName ) ; + if( !ret.empty() ) // we found something return ret; #ifdef _DEBUG diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index 36a472dfcc..22330947c5 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -39,7 +39,7 @@ public: protected: void GetAllThemeNames( CStringArray& AddTo ); - + CString GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName ); static CString GetThemeDirFromName( const CString &sThemeName ); CString GetElementDir( CString sThemeName ); static CString GetMetricsPathFromName( CString sThemeName );