fix radar values don't get recalculated after changing steps in editor

fix radar values shown for edits if copied from official steps
This commit is contained in:
Chris Danford
2005-04-03 21:43:29 +00:00
parent 3c5a892b27
commit 9d16a66f77
4 changed files with 35 additions and 18 deletions
+19 -2
View File
@@ -151,6 +151,23 @@ void Steps::TidyUpData()
SetMeter( int(PredictMeter()) );
}
void Steps::CalculateRadarValues( float fMusicLengthSeconds )
{
m_RadarValues = RadarValues();
// If we're autogen, don't calculate values. GetRadarValues will take from our parent.
if( parent != NULL )
return;
// If we're an edit, leave the RadarValues invalid.
if( IsAnEdit() )
return;
NoteData tempNoteData;
this->GetNoteData( tempNoteData );
NoteDataUtil::GetRadarValues( tempNoteData, fMusicLengthSeconds, m_RadarValues );
}
void Steps::Decompress() const
{
if( m_bNoteDataIsFilled )
@@ -266,7 +283,7 @@ void Steps::AutogenFrom( const Steps *parent_, StepsType ntTo )
m_StepsType = ntTo;
}
void Steps::CopyFrom( Steps* pSource, StepsType ntTo ) // pSource does not have to be of the same StepsType!
void Steps::CopyFrom( Steps* pSource, StepsType ntTo, float fMusicLengthSeconds ) // pSource does not have to be of the same StepsType
{
m_StepsType = ntTo;
NoteData noteData;
@@ -276,7 +293,7 @@ void Steps::CopyFrom( Steps* pSource, StepsType ntTo ) // pSource does not have
this->SetDescription( pSource->GetDescription() );
this->SetDifficulty( pSource->GetDifficulty() );
this->SetMeter( pSource->GetMeter() );
this->SetRadarValues( pSource->GetRadarValues() );
this->CalculateRadarValues( fMusicLengthSeconds );
}
void Steps::CreateBlank( StepsType ntTo )