show life and combo graphs over the whole song/course - not just over the time the player was alive
This commit is contained in:
@@ -12,19 +12,22 @@ const int MinComboSizeToShow = 5;
|
||||
|
||||
static ThemeMetric<float> NUMBERS_Y("ComboGraph","NumbersY");
|
||||
|
||||
void ComboGraph::Load( const CString& sScreen, const CString& sElement, const StageStats &s, PlayerNumber pn )
|
||||
void ComboGraph::Load( const CString& sScreen, const CString& sElement, const StageStats &s, const PlayerStageStats &pss )
|
||||
{
|
||||
ASSERT( m_SubActors.size() == 0 );
|
||||
|
||||
const float fFirstSecond = 0;
|
||||
const float fLastSecond = s.GetTotalPossibleMusicLengthSeconds();
|
||||
|
||||
/* Find the largest combo. */
|
||||
int MaxComboSize = 0;
|
||||
for( unsigned i = 0; i < s.m_player[pn].ComboList.size(); ++i )
|
||||
MaxComboSize = max( MaxComboSize, s.m_player[pn].ComboList[i].GetStageCnt() );
|
||||
for( unsigned i = 0; i < pss.ComboList.size(); ++i )
|
||||
MaxComboSize = max( MaxComboSize, pss.ComboList[i].GetStageCnt() );
|
||||
|
||||
float width = -1;
|
||||
for( unsigned i = 0; i < s.m_player[pn].ComboList.size(); ++i )
|
||||
for( unsigned i = 0; i < pss.ComboList.size(); ++i )
|
||||
{
|
||||
const PlayerStageStats::Combo_t &combo = s.m_player[pn].ComboList[i];
|
||||
const PlayerStageStats::Combo_t &combo = pss.ComboList[i];
|
||||
if( combo.GetStageCnt() < MinComboSizeToShow )
|
||||
continue; /* too small */
|
||||
|
||||
@@ -35,8 +38,8 @@ void ComboGraph::Load( const CString& sScreen, const CString& sElement, const St
|
||||
sprite->SetName( "ComboBar" );
|
||||
sprite->Load( THEME->GetPathG( sScreen, sElement + (IsMax? " max":" normal") ) );
|
||||
|
||||
const float start = SCALE( combo.fStartSecond, s.m_player[pn].fFirstSecond, s.m_player[pn].fLastSecond, 0.0f, 1.0f );
|
||||
const float size = SCALE( combo.fSizeSeconds, 0, s.m_player[pn].fLastSecond-s.m_player[pn].fFirstSecond, 0.0f, 1.0f );
|
||||
const float start = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
|
||||
const float size = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
|
||||
sprite->SetCropLeft ( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) );
|
||||
sprite->SetCropRight( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) );
|
||||
|
||||
@@ -51,9 +54,9 @@ void ComboGraph::Load( const CString& sScreen, const CString& sElement, const St
|
||||
this->AddChild( sprite );
|
||||
}
|
||||
|
||||
for( unsigned i = 0; i < s.m_player[pn].ComboList.size(); ++i )
|
||||
for( unsigned i = 0; i < pss.ComboList.size(); ++i )
|
||||
{
|
||||
const PlayerStageStats::Combo_t &combo = s.m_player[pn].ComboList[i];
|
||||
const PlayerStageStats::Combo_t &combo = pss.ComboList[i];
|
||||
if( combo.GetStageCnt() < MinComboSizeToShow )
|
||||
continue; /* too small */
|
||||
|
||||
@@ -68,8 +71,8 @@ void ComboGraph::Load( const CString& sScreen, const CString& sElement, const St
|
||||
text->SetName( "ComboMaxNumber" );
|
||||
text->LoadFromFont( THEME->GetPathF(sScreen,sElement) );
|
||||
|
||||
const float start = SCALE( combo.fStartSecond, s.m_player[pn].fFirstSecond, s.m_player[pn].fLastSecond, 0.0f, 1.0f );
|
||||
const float size = SCALE( combo.fSizeSeconds, 0, s.m_player[pn].fLastSecond-s.m_player[pn].fFirstSecond, 0.0f, 1.0f );
|
||||
const float start = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
|
||||
const float size = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
|
||||
|
||||
const float CenterPercent = start + size/2;
|
||||
const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f );
|
||||
|
||||
Reference in New Issue
Block a user