try to simplify this UpdateNonstopLifebar stuff (which seems to have
nothing to do with Nonstop). This stuff is very tweaky and should probably be broken out into Lua or something.
This commit is contained in:
@@ -33,7 +33,7 @@ public:
|
||||
virtual bool IsHot() const = 0;
|
||||
virtual bool IsFailing() const = 0;
|
||||
virtual float GetLife() const { return 0; } // for cosmetic use only
|
||||
virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) = 0;
|
||||
virtual void UpdateNonstopLifebar() { }
|
||||
|
||||
static LifeMeter *MakeLifeMeter( SongOptions::LifeType t );
|
||||
|
||||
|
||||
@@ -329,8 +329,30 @@ void LifeMeterBar::DrawPrimitives()
|
||||
ActorFrame::DrawPrimitives();
|
||||
}
|
||||
#include "RageLog.h"
|
||||
void LifeMeterBar::UpdateNonstopLifebar( const int cleared, const int total, int ProgressiveLifebarDifficulty )
|
||||
#include "Course.h"
|
||||
void LifeMeterBar::UpdateNonstopLifebar()
|
||||
{
|
||||
int cleared, total, ProgressiveLifebarDifficulty;
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_REGULAR:
|
||||
if( GAMESTATE->IsEventMode() || GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
return;
|
||||
|
||||
cleared = GAMESTATE->GetStageIndex();
|
||||
total = PREFSMAN->m_iSongsPerPlay;
|
||||
ProgressiveLifebarDifficulty = PREFSMAN->m_iProgressiveStageLifebar;
|
||||
break;
|
||||
case PLAY_MODE_NONSTOP:
|
||||
cleared = GAMESTATE->GetCourseSongIndex();
|
||||
total = GAMESTATE->m_pCurCourse->GetEstimatedNumStages();
|
||||
ProgressiveLifebarDifficulty = PREFSMAN->m_iProgressiveNonstopLifebar;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// if (cleared > total) cleared = total; // clear/total <= 1
|
||||
// if (total == 0) total = 1; // no division by 0
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
virtual bool IsFailing() const;
|
||||
virtual float GetLife() const { return m_fLifePercentage; }
|
||||
|
||||
void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty);
|
||||
void UpdateNonstopLifebar();
|
||||
void FillForHowToPlay(int NumT2s, int NumMisses);
|
||||
// this function is solely for HowToPlay
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
virtual bool IsHot() const;
|
||||
virtual bool IsFailing() const;
|
||||
virtual float GetLife() const;
|
||||
virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) { };
|
||||
|
||||
void Refresh();
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ public:
|
||||
virtual bool IsHot() const;
|
||||
virtual bool IsFailing() const;
|
||||
virtual float GetLife() const;
|
||||
virtual void UpdateNonstopLifebar(int cleared, int total, int ProgressiveLifebarDifficulty) { };
|
||||
|
||||
private:
|
||||
float GetLifeSeconds() const;
|
||||
|
||||
@@ -1086,25 +1086,8 @@ void ScreenGameplay::LoadNextSong()
|
||||
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==SongOptions::LIFE_BATTERY && pi->GetPlayerStageStats()->bFailed ) // already failed
|
||||
pi->ShowOniGameOver();
|
||||
|
||||
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==SongOptions::LIFE_BAR &&
|
||||
GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR &&
|
||||
!GAMESTATE->IsEventMode() &&
|
||||
!GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
{
|
||||
if( pi->m_pLifeMeter )
|
||||
pi->m_pLifeMeter->UpdateNonstopLifebar(
|
||||
GAMESTATE->GetStageIndex(),
|
||||
PREFSMAN->m_iSongsPerPlay,
|
||||
PREFSMAN->m_iProgressiveStageLifebar);
|
||||
}
|
||||
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==SongOptions::LIFE_BAR && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP )
|
||||
{
|
||||
if( pi->m_pLifeMeter )
|
||||
pi->m_pLifeMeter->UpdateNonstopLifebar(
|
||||
GAMESTATE->GetCourseSongIndex(),
|
||||
GAMESTATE->m_pCurCourse->GetEstimatedNumStages(),
|
||||
PREFSMAN->m_iProgressiveNonstopLifebar);
|
||||
}
|
||||
if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==SongOptions::LIFE_BAR && pi->m_pLifeMeter )
|
||||
pi->m_pLifeMeter->UpdateNonstopLifebar();
|
||||
|
||||
if( pi->m_pDifficultyIcon )
|
||||
pi->m_pDifficultyIcon->SetFromSteps( pi->GetStepsAndTrailIndex(), pSteps );
|
||||
|
||||
Reference in New Issue
Block a user