ThemeManager::GetClassFallback
This commit is contained in:
@@ -700,10 +700,9 @@ RString ThemeManager::GetPathToAndFallback( ElementCategory category, const RStr
|
|||||||
return RString();
|
return RString();
|
||||||
|
|
||||||
// search fallback name (if any)
|
// search fallback name (if any)
|
||||||
RString sFallback;
|
sClassName = GetClassFallback( sClassName );
|
||||||
if( !GetMetricRawRecursive( g_pLoadedThemeData->iniMetrics, sClassName, "Fallback", sFallback) )
|
if( sClassName.empty() )
|
||||||
return RString();
|
return RString();
|
||||||
sClassName = sFallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RageException::Throw( "Infinite recursion looking up theme element \"%s\"",
|
RageException::Throw( "Infinite recursion looking up theme element \"%s\"",
|
||||||
@@ -819,6 +818,16 @@ void ThemeManager::ReloadMetrics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RString ThemeManager::GetClassFallback( const RString &sClassName )
|
||||||
|
{
|
||||||
|
// always look in iniMetrics for "Fallback"
|
||||||
|
RString sFallback;
|
||||||
|
if( !GetMetricRawRecursive(g_pLoadedThemeData->iniMetrics,sClassName,"Fallback",sFallback) )
|
||||||
|
return RString();
|
||||||
|
|
||||||
|
return sFallback;
|
||||||
|
}
|
||||||
|
|
||||||
bool ThemeManager::GetMetricRawRecursive( const IniFile &ini, const RString &sClassName_, const RString &sValueName, RString &sOut )
|
bool ThemeManager::GetMetricRawRecursive( const IniFile &ini, const RString &sClassName_, const RString &sValueName, RString &sOut )
|
||||||
{
|
{
|
||||||
ASSERT( sValueName != "" );
|
ASSERT( sValueName != "" );
|
||||||
@@ -835,12 +844,9 @@ bool ThemeManager::GetMetricRawRecursive( const IniFile &ini, const RString &sCl
|
|||||||
if( !sValueName.compare("Fallback") )
|
if( !sValueName.compare("Fallback") )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RString sFallback;
|
sClassName = GetClassFallback( sClassName );
|
||||||
// always look in iniMetrics for "Fallback"
|
if( sClassName.empty() )
|
||||||
if( !GetMetricRawRecursive(g_pLoadedThemeData->iniMetrics,sClassName,"Fallback",sFallback) )
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sClassName = sFallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RageException::Throw( "Infinite recursion looking up theme metric \"%s::%s\".", sClassName.c_str(), sValueName.c_str() );
|
RageException::Throw( "Infinite recursion looking up theme metric \"%s::%s\".", sClassName.c_str(), sValueName.c_str() );
|
||||||
@@ -1154,11 +1160,7 @@ void ThemeManager::GetMetricsThatBeginWith( const RString &sClassName_, const RS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// put the fallback (if any) in sClassName
|
// put the fallback (if any) in sClassName
|
||||||
RString sFallback;
|
sClassName = GetClassFallback( sClassName );
|
||||||
if( GetMetricRawRecursive( g_pLoadedThemeData->iniMetrics, sClassName, "Fallback", sFallback ) )
|
|
||||||
sClassName = sFallback;
|
|
||||||
else
|
|
||||||
sClassName = "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ public:
|
|||||||
|
|
||||||
void GetMetricsThatBeginWith( const RString &sClassName, const RString &sValueName, set<RString> &vsValueNamesOut );
|
void GetMetricsThatBeginWith( const RString &sClassName, const RString &sValueName, set<RString> &vsValueNamesOut );
|
||||||
|
|
||||||
|
RString GetClassFallback( const RString &sClassName );
|
||||||
|
|
||||||
static RString GetBlankGraphicPath();
|
static RString GetBlankGraphicPath();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user