move DifficultiesToShow into CommonMetrics

re-cache on theme reload, not on timer expired
This commit is contained in:
Chris Danford
2005-03-10 19:57:43 +00:00
parent 22d64c8fd9
commit 8b32383969
9 changed files with 98 additions and 101 deletions
+11 -12
View File
@@ -12,6 +12,7 @@
#include "StepsUtil.h"
#include "CommonMetrics.h"
#include "Command.h"
#include "Foreach.h"
#define MAX_METERS NUM_DIFFICULTIES + MAX_EDITS_PER_SONG
@@ -283,27 +284,25 @@ void DifficultyList::SetFromGameState()
// FIXME: This clamps to between the min and the max difficulty, but
// it really should round to the nearest difficulty that's in
// DIFFICULTIES_TO_SHOW.
CStringArray asDiff;
split( DIFFICULTIES_TO_SHOW.GetValue(), ",", asDiff );
for( unsigned i=0; i<asDiff.size(); i++ )
const set<Difficulty> &diffs = CommonMetrics::GetDifficultiesToShow();
unsigned i=0;
FOREACHS_CONST( Difficulty, diffs, d )
{
Difficulty d = StringToDifficulty( asDiff[i] );
if( d == DIFFICULTY_INVALID )
continue;
m_Rows.resize( m_Rows.size()+1 );
Row &row = m_Rows.back();
row.m_dc = d;
row.m_dc = *d;
m_Lines[i].m_Meter.SetFromMeterAndDifficulty( 3*(d), d );
m_Lines[i].m_Meter.SetFromMeterAndDifficulty( 3*(*d), *d );
m_Lines[i].m_Description.SetText( GetDifficultyString(d) );
m_Lines[i].m_Description.SetDiffuseColor( SONGMAN->GetDifficultyColor(d) );
m_Lines[i].m_Description.SetText( GetDifficultyString(*d) );
m_Lines[i].m_Description.SetDiffuseColor( SONGMAN->GetDifficultyColor(*d) );
m_Lines[i].m_Number.SetDiffuseColor( SONGMAN->GetDifficultyColor(d) );
m_Lines[i].m_Number.SetDiffuseColor( SONGMAN->GetDifficultyColor(*d) );
m_Lines[i].m_Number.SetText( "?" );
i++;
}
}
else