add meter to options screen Steps row

set preferred difficulty when changing options screen Steps row
This commit is contained in:
Chris Danford
2003-11-29 18:10:43 +00:00
parent cfd2ce59f5
commit 3952930730
4 changed files with 27 additions and 20 deletions
+6 -4
View File
@@ -149,12 +149,14 @@ void DifficultyList::SetFromGameState()
continue;
}
met.SetFromNotes( m_CurSteps[m] );
const CString desc = m_CurSteps[m]->GetDescription();
Steps* pSteps = m_CurSteps[m];
met.SetFromNotes( pSteps );
Difficulty dc = pSteps->GetDifficulty();
m_Descriptions[m].SetZoomX(1);
m_Descriptions[m].SetTextMaxWidth( DESCRIPTION_MAX_WIDTH, SONGMAN->GetDifficultyThemeName(desc) );
m_Descriptions[m].SetTextMaxWidth( DESCRIPTION_MAX_WIDTH, SONGMAN->GetDifficultyThemeName(dc) );
/* Don't mess with alpha; it might be fading on. */
m_Descriptions[m].SetDiffuseColor( SONGMAN->GetDifficultyColor( m_CurSteps[m]->GetDifficulty() ) );
m_Descriptions[m].SetDiffuseColor( SONGMAN->GetDifficultyColor(dc) );
}
}
+17 -12
View File
@@ -105,16 +105,17 @@ void ScreenOptionsMaster::SetStep( OptionRow &row, OptionRowHandler &hand )
}
else if( GAMESTATE->m_pCurSong ) // playing a song
{
vector<Steps*> vNotes;
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
SortNotesArrayByDifficulty( vNotes );
for( unsigned i=0; i<vNotes.size(); i++ )
vector<Steps*> vSteps;
GAMESTATE->m_pCurSong->GetSteps( vSteps, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
SortNotesArrayByDifficulty( vSteps );
for( unsigned i=0; i<vSteps.size(); i++ )
{
CString s = vNotes[i]->GetDescription();
s.MakeUpper();
Steps* pSteps = vSteps[i];
// convert to theme-defined values
s = SONGMAN->GetDifficultyThemeName(s);
CString s;
// convert to theme-defined difficulty name
s = SONGMAN->GetDifficultyThemeName( pSteps->GetDifficulty() );
s += ssprintf( " (%d)", pSteps->GetMeter() );
row.choices.push_back( s );
}
@@ -443,10 +444,14 @@ int ScreenOptionsMaster::ExportOption( const OptionRow &row, const OptionRowHand
}
else if( GAMESTATE->m_pCurSong ) // playing a song
{
vector<Steps*> vNotes;
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
SortNotesArrayByDifficulty( vNotes );
GAMESTATE->m_pCurNotes[pn] = vNotes[ sel ];
vector<Steps*> vSteps;
GAMESTATE->m_pCurSong->GetSteps( vSteps, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
SortNotesArrayByDifficulty( vSteps );
Steps* pSteps = vSteps[ sel ];
// set current notes
GAMESTATE->m_pCurNotes[pn] = pSteps;
// set preferred difficulty
GAMESTATE->m_PreferredDifficulty[pn] = pSteps->GetDifficulty();
}
break;
+3 -3
View File
@@ -914,16 +914,16 @@ RageColor SongManager::GetDifficultyColor( Difficulty dc ) const
}
}
CString SongManager::GetDifficultyThemeName( const CString &in ) const
CString SongManager::GetDifficultyThemeName( Difficulty dc ) const
{
switch( StringToDifficulty(in) )
switch( dc )
{
case DIFFICULTY_BEGINNER: return BEGINNER_DESCRIPTION;
case DIFFICULTY_EASY: return EASY_DESCRIPTION;
case DIFFICULTY_MEDIUM: return MEDIUM_DESCRIPTION;
case DIFFICULTY_HARD: return HARD_DESCRIPTION;
case DIFFICULTY_CHALLENGE: return CHALLENGE_DESCRIPTION;
default: return in; // something else
default: ASSERT(0); return ""; // something else
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ public:
RageColor GetGroupColor( const CString &sGroupName );
RageColor GetSongColor( const Song* pSong );
RageColor GetDifficultyColor( Difficulty dc ) const;
CString GetDifficultyThemeName( const CString &in ) const;
CString GetDifficultyThemeName( Difficulty dc ) const;
static CString ShortenGroupName( CString sLongGroupName );
static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3