optimize Stats.xml size: Allow theme to turn off writing off certain RadarValues
This commit is contained in:
@@ -4710,3 +4710,7 @@ InternetRankingViewGuidUrl=
|
|||||||
ProductTitle=StepMania
|
ProductTitle=StepMania
|
||||||
FooterText=generated by StepMania
|
FooterText=generated by StepMania
|
||||||
FooterLink=http://www.stepmania.com
|
FooterLink=http://www.stepmania.com
|
||||||
|
|
||||||
|
[RadarValues]
|
||||||
|
WriteComplexValues=1
|
||||||
|
WriteSimpleValues=1
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
|
||||||
|
#define WRITE_COMPLEX_VALUES THEME->GetMetricB("RadarValues","WriteComplexValues")
|
||||||
|
#define WRITE_SIMPLE_VALUES THEME->GetMetricB("RadarValues","WriteSimpleValues")
|
||||||
|
|
||||||
RadarValues::RadarValues()
|
RadarValues::RadarValues()
|
||||||
{
|
{
|
||||||
@@ -31,10 +34,16 @@ XNode* RadarValues::CreateNode() const
|
|||||||
FOREACH_RadarCategory( rc )
|
FOREACH_RadarCategory( rc )
|
||||||
{
|
{
|
||||||
if( rc >= RADAR_NUM_TAPS_AND_HOLDS )
|
if( rc >= RADAR_NUM_TAPS_AND_HOLDS )
|
||||||
|
{
|
||||||
|
if( WRITE_SIMPLE_VALUES )
|
||||||
pNode->AppendChild( RadarCategoryToString(rc), (int)m_fValues[rc] );
|
pNode->AppendChild( RadarCategoryToString(rc), (int)m_fValues[rc] );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if( WRITE_COMPLEX_VALUES )
|
||||||
pNode->AppendChild( RadarCategoryToString(rc), m_fValues[rc] );
|
pNode->AppendChild( RadarCategoryToString(rc), m_fValues[rc] );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pNode;
|
return pNode;
|
||||||
}
|
}
|
||||||
@@ -43,6 +52,8 @@ void RadarValues::LoadFromNode( const XNode* pNode )
|
|||||||
{
|
{
|
||||||
ASSERT( pNode->name == "RadarValues" );
|
ASSERT( pNode->name == "RadarValues" );
|
||||||
|
|
||||||
|
Zero();
|
||||||
|
|
||||||
CString s;
|
CString s;
|
||||||
|
|
||||||
FOREACH_RadarCategory( rc )
|
FOREACH_RadarCategory( rc )
|
||||||
|
|||||||
Reference in New Issue
Block a user