Previously, theme metric lookups follows Fallback at every place; for
example, if a base theme had: [Derived] Fallback=Base1 [Base1] A=1 and a derived theme had: [Derived] Fallback=Base2 [Base2] then the lookup "Derived", "A" would find 1. This is confusing and inconsistent: it means that the value of Derived::Fallback has two values, both Base1 and Base2, and Base1 is only accessible by the internal metric lookup. Every metric should have only one value; "Fallback=Base1" should be completely overridden here. (This also reduces the difference between theme lookups and path lookups; path lookups did not have this anomaly, as they did not have access to the extra Fallback value.)
This commit is contained in:
@@ -584,17 +584,17 @@ bool ThemeManager::GetMetricRawRecursive( const CString &sClassName, const CStri
|
|||||||
if( level > 100 )
|
if( level > 100 )
|
||||||
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() );
|
||||||
|
|
||||||
CString sFallback;
|
|
||||||
|
|
||||||
FOREACHD_CONST( Theme, g_vThemes, iter )
|
FOREACHD_CONST( Theme, g_vThemes, iter )
|
||||||
{
|
{
|
||||||
if( iter->iniMetrics->GetValue(sClassName,sValueName,ret) )
|
if( iter->iniMetrics->GetValue(sClassName,sValueName,ret) )
|
||||||
return true;
|
return true;
|
||||||
if( iter->iniMetrics->GetValue(sClassName,"Fallback",sFallback) )
|
|
||||||
{
|
|
||||||
if( GetMetricRawRecursive(sFallback,sValueName,ret,level+1) )
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FOREACHD_CONST( Theme, g_vThemes, iter )
|
||||||
|
{
|
||||||
|
CString sFallback;
|
||||||
|
if( iter->iniMetrics->GetValue(sClassName,"Fallback",sFallback) )
|
||||||
|
return GetMetricRawRecursive(sFallback,sValueName,ret,level+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user