fixed ThemeManager using element in base theme instead of current theme if base theme has a redir, simplifed a few sound element names.

This commit is contained in:
Chris Danford
2003-01-26 21:45:13 +00:00
parent 5a7b10e989
commit 229aa2cae9
6 changed files with 57 additions and 63 deletions
+3 -3
View File
@@ -76,8 +76,8 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic()
); );
this->AddChild( &m_Menu ); this->AddChild( &m_Menu );
m_soundMusicChange.Load( THEME->GetPathTo("Sounds","select music change song")); m_soundMusicChange.Load( THEME->GetPathTo("Sounds","select music change"));
m_soundMusicCycle.Load( THEME->GetPathTo("Sounds","select music cycle songs")); m_soundMusicCycle.Load( THEME->GetPathTo("Sounds","select music cycle"));
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_ChoiceListFrame.Load( THEME->GetPathTo("Graphics","select mode list frame")); m_ChoiceListFrame.Load( THEME->GetPathTo("Graphics","select mode list frame"));
@@ -157,7 +157,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic()
m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) );
this->AddChild( &m_sprOptionsMessage ); 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_bGoToOptions = false;
m_bMadeChoice = false; m_bMadeChoice = false;
+2
View File
@@ -116,6 +116,7 @@ ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking","ranking")
} }
} }
{
vector<CString> asCoursePaths; vector<CString> asCoursePaths;
split( COURSES_TO_SHOW, ",", asCoursePaths, true ); split( COURSES_TO_SHOW, ",", asCoursePaths, true );
for( unsigned i=0; i<aNotesTypesToShow.size(); i++ ) for( unsigned i=0; i<aNotesTypesToShow.size(); i++ )
@@ -130,6 +131,7 @@ ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking","ranking")
m_vPagesToShow.push_back( pts ); m_vPagesToShow.push_back( pts );
} }
} }
}
this->MoveToTail( &m_Fade ); this->MoveToTail( &m_Fade );
+3 -3
View File
@@ -228,9 +228,9 @@ ScreenSelectMusic::ScreenSelectMusic()
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") ); m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music change notes") ); m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music notes") );
m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music change options") ); m_soundOptionsChange.Load( THEME->GetPathTo("Sounds","select music options") );
m_soundLocked.Load( THEME->GetPathTo("Sounds","select music wheel locked") ); m_soundLocked.Load( THEME->GetPathTo("Sounds","select music locked") );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music intro") ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select music intro") );
+18 -10
View File
@@ -57,7 +57,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /pdb:none # SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Release6 IntDir=.\../Release6
TargetDir=\Stepmania\stepmania TargetDir=\stepmania\stepmania
TargetName=StepMania TargetName=StepMania
SOURCE="$(InputPath)" 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)\
@@ -92,7 +92,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Debug6 IntDir=.\../Debug6
TargetDir=\Stepmania\stepmania TargetDir=\stepmania\stepmania
TargetName=StepMania-debug TargetName=StepMania-debug
SOURCE="$(InputPath)" 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)\
@@ -1473,14 +1473,6 @@ SOURCE=.\ScreenGraphicOptions.h
# End Source File # End Source File
# Begin 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 SOURCE=.\ScreenHowToPlay.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -1549,6 +1541,14 @@ SOURCE=.\ScreenMusicScroll.h
# End Source File # End Source File
# Begin 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 SOURCE=.\ScreenOptions.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -1573,6 +1573,14 @@ SOURCE=.\ScreenPrompt.h
# End Source File # End Source File
# Begin 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 SOURCE=.\ScreenSandbox.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
+18 -34
View File
@@ -116,29 +116,21 @@ CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
return THEMES_DIR + sThemeName + "\\"; return THEMES_DIR + sThemeName + "\\";
} }
CString ThemeManager::GetPathToOptional( CString sAssetCategory, CString sFileName ) CString ThemeManager::GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName )
{ {
try_element_again: try_element_again:
sAssetCategory.MakeLower(); sAssetCategory.MakeLower();
sFileName.MakeLower(); sFileName.MakeLower();
const CString sCurrentThemeDir = GetThemeDirFromName( m_sCurThemeName ); const CString sThemeDir = GetThemeDirFromName( sThemeName );
const CString sDefaultThemeDir = GetThemeDirFromName( BASE_THEME_NAME );
CStringArray asPossibleElementFilePaths; CStringArray asPossibleElementFilePaths;
///////////////////////////////////////
// Search both the current theme and the default theme dirs for this element
///////////////////////////////////////
/* First, look for redirs. */ /* First, look for redirs. */
GetDirListing( sCurrentThemeDir + sAssetCategory+"/"+sFileName + ".redir", GetDirListing( sThemeDir + sAssetCategory+"/"+sFileName + ".redir",
asPossibleElementFilePaths, false, true );
if(asPossibleElementFilePaths.empty())
GetDirListing( sDefaultThemeDir + sAssetCategory+"/"+sFileName + ".redir",
asPossibleElementFilePaths, false, true ); 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]); CString sNewFilePath = DerefRedir(asPossibleElementFilePaths[0]);
@@ -200,44 +192,36 @@ try_element_again:
if( sAssetCategory == "bganimations" ) if( sAssetCategory == "bganimations" )
DirsOnly=true; DirsOnly=true;
int i; for(int i = 0; asset_masks[i]; ++i)
for(i = 0; asset_masks[i]; ++i) GetDirListing( sThemeDir + sAssetCategory+"/" + sFileName + asset_masks[i],
{
GetDirListing( sCurrentThemeDir + sAssetCategory+"/" + sFileName + asset_masks[i],
asPossibleElementFilePaths, DirsOnly, true ); asPossibleElementFilePaths, DirsOnly, true );
}
if( sAssetCategory == "fonts" ) if( sAssetCategory == "fonts" )
Font::WeedFontNames(asPossibleElementFilePaths, sFileName); 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()) if(asPossibleElementFilePaths.empty())
return ""; 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 ) CString ThemeManager::GetPathTo( CString sAssetCategory, CString sFileName )
{ {
#ifdef _DEBUG #ifdef _DEBUG
try_element_again: try_element_again:
#endif #endif
CString ret = GetPathToOptional(sAssetCategory, sFileName); CString ret = GetPathToOptional( sAssetCategory, sFileName ) ;
if( !ret.empty() ) // we found something
/* If it's empty, we found nothing. */
if( !ret.empty() )
return ret; return ret;
#ifdef _DEBUG #ifdef _DEBUG
+1 -1
View File
@@ -39,7 +39,7 @@ public:
protected: protected:
void GetAllThemeNames( CStringArray& AddTo ); void GetAllThemeNames( CStringArray& AddTo );
CString GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName );
static CString GetThemeDirFromName( const CString &sThemeName ); static CString GetThemeDirFromName( const CString &sThemeName );
CString GetElementDir( CString sThemeName ); CString GetElementDir( CString sThemeName );
static CString GetMetricsPathFromName( CString sThemeName ); static CString GetMetricsPathFromName( CString sThemeName );