diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index ca51ac776e..34007bfb60 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -707,3 +707,15 @@ void LifeStream::DrawPrimitives() } */ + +void LifeMeterBar::FillForHowToPlay(int NumPerfects, int NumMisses) +{ + m_iProgressiveLifebar = 0; // disable progressive lifebar + + float AmountForPerfect = NumPerfects * m_fLifeDifficulty * 0.008f; + float AmountForMiss = NumMisses / m_fLifeDifficulty * 0.08f; + + m_fLifePercentage = AmountForMiss - AmountForPerfect; + CLAMP( m_fLifePercentage, 0.0f, 1.0f ); + AfterLifeChanged(); +} diff --git a/stepmania/src/LifeMeterBar.h b/stepmania/src/LifeMeterBar.h index e732c326ef..5b26308c14 100644 --- a/stepmania/src/LifeMeterBar.h +++ b/stepmania/src/LifeMeterBar.h @@ -38,6 +38,8 @@ public: virtual bool FailedEarlier(); void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty); + void FillForHowToPlay(int NumPerfects, int NumMisses); + // this function is solely for HowToPlay private: void ResetBarVelocity(); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 72a0db9807..358c412f4e 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -46,7 +46,9 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay") m_LifeMeterBar.SetXY( 480, 40 ); // we need to be a little lower than half if we want to hit // zero with the actual miss steps. cheat. - m_LifeMeterBar.ChangeLife(TNS_MISS); +// m_LifeMeterBar.ChangeLife(TNS_MISS); + // nicer fix :P it depends on difficulty + m_LifeMeterBar.FillForHowToPlay(4, 6); // Display random character+pad if( GAMESTATE->m_pCharacters.size() )