handle locks
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "UnlockSystem.h"
|
||||||
|
|
||||||
|
|
||||||
#define STEPS_TYPES_TO_HIDE THEME->GetMetric ("ScreenRanking","StepsTypesToHide")
|
#define STEPS_TYPES_TO_HIDE THEME->GetMetric ("ScreenRanking","StepsTypesToHide")
|
||||||
@@ -170,7 +171,6 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
|
|
||||||
// init Actors for all_steps
|
// init Actors for all_steps
|
||||||
{
|
{
|
||||||
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
|
||||||
for( int d=0; d<NUM_DIFFICULTIES; d++ )
|
for( int d=0; d<NUM_DIFFICULTIES; d++ )
|
||||||
{
|
{
|
||||||
bool bShowThis = find(m_vDiffsToShow.begin(), m_vDiffsToShow.end(), d) != m_vDiffsToShow.end();
|
bool bShowThis = find(m_vDiffsToShow.begin(), m_vDiffsToShow.end(), d) != m_vDiffsToShow.end();
|
||||||
@@ -182,9 +182,15 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
m_sprDifficulty[d].SetHidden( true );
|
m_sprDifficulty[d].SetHidden( true );
|
||||||
this->AddChild( &m_sprDifficulty[d] );
|
this->AddChild( &m_sprDifficulty[d] );
|
||||||
}
|
}
|
||||||
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
for( unsigned s=0; s<num_songs; s++ )
|
for( unsigned s=0; s<num_songs; s++ )
|
||||||
{
|
{
|
||||||
|
Song *pSong = SONGMAN->GetAllSongs()[s];
|
||||||
|
if( UNLOCKSYS->SongIsLocked(pSong) )
|
||||||
|
continue;
|
||||||
|
|
||||||
StepsScoreRowItem* pStepsScoreRowItem = new StepsScoreRowItem;
|
StepsScoreRowItem* pStepsScoreRowItem = new StepsScoreRowItem;
|
||||||
|
pStepsScoreRowItem ->m_pSong = pSong;
|
||||||
|
|
||||||
pStepsScoreRowItem->m_sprSongFrame.SetName( "SongFrame" );
|
pStepsScoreRowItem->m_sprSongFrame.SetName( "SongFrame" );
|
||||||
pStepsScoreRowItem->m_sprSongFrame.SetHidden( true );
|
pStepsScoreRowItem->m_sprSongFrame.SetHidden( true );
|
||||||
@@ -227,27 +233,31 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
LOG->Trace("rankings: adding %i courses", courses.size());
|
LOG->Trace("rankings: adding %i courses", courses.size());
|
||||||
for( unsigned s=0; s<courses.size(); s++ )
|
for( unsigned s=0; s<courses.size(); s++ )
|
||||||
{
|
{
|
||||||
StepsScoreRowItem* pStepsScoreRowItem = new StepsScoreRowItem;
|
if( UNLOCKSYS->CourseIsLocked(courses[s]) )
|
||||||
|
continue;
|
||||||
|
|
||||||
pStepsScoreRowItem->m_sprSongFrame.SetName( "CourseListFrame" );
|
CourseScoreRowItem* pCourseScoreRowItem = new CourseScoreRowItem;
|
||||||
pStepsScoreRowItem->m_sprSongFrame.SetHidden( true );
|
pCourseScoreRowItem->m_pCourse = courses[s];
|
||||||
pStepsScoreRowItem->m_sprSongFrame.Load( THEME->GetPathToG("ScreenRanking course frame") );
|
|
||||||
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_sprSongFrame );
|
|
||||||
|
|
||||||
pStepsScoreRowItem->m_textSongTitle.SetName( "CourseListTitle" );
|
pCourseScoreRowItem->m_sprSongFrame.SetName( "CourseListFrame" );
|
||||||
pStepsScoreRowItem->m_textSongTitle.SetHidden( true );
|
pCourseScoreRowItem->m_sprSongFrame.SetHidden( true );
|
||||||
pStepsScoreRowItem->m_textSongTitle.LoadFromFont( THEME->GetPathToF("ScreenRanking course list title") );
|
pCourseScoreRowItem->m_sprSongFrame.Load( THEME->GetPathToG("ScreenRanking course frame") );
|
||||||
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_textSongTitle );
|
pCourseScoreRowItem->AddChild( &pCourseScoreRowItem->m_sprSongFrame );
|
||||||
|
|
||||||
|
pCourseScoreRowItem->m_textSongTitle.SetName( "CourseListTitle" );
|
||||||
|
pCourseScoreRowItem->m_textSongTitle.SetHidden( true );
|
||||||
|
pCourseScoreRowItem->m_textSongTitle.LoadFromFont( THEME->GetPathToF("ScreenRanking course list title") );
|
||||||
|
pCourseScoreRowItem->AddChild( &pCourseScoreRowItem->m_textSongTitle );
|
||||||
|
|
||||||
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
||||||
{
|
{
|
||||||
pStepsScoreRowItem->m_textStepsScore[d].SetName( "CourseListScore" );
|
pCourseScoreRowItem->m_textStepsScore[d].SetName( "CourseListScore" );
|
||||||
pStepsScoreRowItem->m_textStepsScore[d].LoadFromFont( THEME->GetPathToF("ScreenRanking course list score") );
|
pCourseScoreRowItem->m_textStepsScore[d].LoadFromFont( THEME->GetPathToF("ScreenRanking course list score") );
|
||||||
pStepsScoreRowItem->m_textStepsScore[d].SetHidden( true );
|
pCourseScoreRowItem->m_textStepsScore[d].SetHidden( true );
|
||||||
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_textStepsScore[d] );
|
pCourseScoreRowItem->AddChild( &pCourseScoreRowItem->m_textStepsScore[d] );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vpCourseScoreRowItem.push_back( pStepsScoreRowItem );
|
m_vpCourseScoreRowItem.push_back( pCourseScoreRowItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ListCourseRowItems.SetName( "ListCourseRowItems" );
|
m_ListCourseRowItems.SetName( "ListCourseRowItems" );
|
||||||
@@ -547,7 +557,6 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
|
||||||
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
||||||
{
|
{
|
||||||
m_sprDifficulty[*dc_iter].SetHidden( !bShowDifficulty );
|
m_sprDifficulty[*dc_iter].SetHidden( !bShowDifficulty );
|
||||||
@@ -572,7 +581,7 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
vpActors.push_back( m_vpStepsScoreRowItem[i] );
|
vpActors.push_back( m_vpStepsScoreRowItem[i] );
|
||||||
m_ListScoreRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
|
m_ListScoreRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
|
||||||
|
|
||||||
for( unsigned s=0; s<num_songs; s++ )
|
for( unsigned s=0; s<m_vpStepsScoreRowItem.size(); s++ )
|
||||||
{
|
{
|
||||||
StepsScoreRowItem *pStepsScoreRowItems = m_vpStepsScoreRowItem[s];
|
StepsScoreRowItem *pStepsScoreRowItems = m_vpStepsScoreRowItem[s];
|
||||||
pStepsScoreRowItems->m_sprSongFrame.Reset();
|
pStepsScoreRowItems->m_sprSongFrame.Reset();
|
||||||
@@ -622,28 +631,26 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
vpActors.push_back( m_vpCourseScoreRowItem[i] );
|
vpActors.push_back( m_vpCourseScoreRowItem[i] );
|
||||||
m_ListCourseRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
|
m_ListCourseRowItems.Load( vpActors, SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0, false );
|
||||||
|
|
||||||
vector<Course*> courses;
|
for( unsigned s=0; s<m_vpCourseScoreRowItem.size(); s++ )
|
||||||
SONGMAN->GetAllCourses( courses, false );
|
|
||||||
for( unsigned s=0; s<courses.size(); s++ )
|
|
||||||
{
|
{
|
||||||
StepsScoreRowItem *pStepsCourseRowItems = m_vpCourseScoreRowItem[s];
|
CourseScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[s];
|
||||||
pStepsCourseRowItems->m_sprSongFrame.Reset();
|
pCourseScoreRowItem->m_sprSongFrame.Reset();
|
||||||
pStepsCourseRowItems->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
|
pCourseScoreRowItem->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
|
||||||
pStepsCourseRowItems->m_sprSongFrame.SetUseZBuffer( true );
|
pCourseScoreRowItem->m_sprSongFrame.SetUseZBuffer( true );
|
||||||
ON_COMMAND( pStepsCourseRowItems->m_sprSongFrame );
|
ON_COMMAND( pCourseScoreRowItem->m_sprSongFrame );
|
||||||
|
|
||||||
pStepsCourseRowItems->m_textSongTitle.Reset();
|
pCourseScoreRowItem->m_textSongTitle.Reset();
|
||||||
pStepsCourseRowItems->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
|
pCourseScoreRowItem->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
|
||||||
pStepsCourseRowItems->m_textSongTitle.SetUseZBuffer( true );
|
pCourseScoreRowItem->m_textSongTitle.SetUseZBuffer( true );
|
||||||
ON_COMMAND( pStepsCourseRowItems->m_textSongTitle );
|
ON_COMMAND( pCourseScoreRowItem->m_textSongTitle );
|
||||||
|
|
||||||
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
||||||
{
|
{
|
||||||
pStepsCourseRowItems->m_textStepsScore[d].Reset();
|
pCourseScoreRowItem->m_textStepsScore[d].Reset();
|
||||||
pStepsCourseRowItems->m_textStepsScore[d].SetXY( COURSE_SCORE_OFFSET_X(d), COURSE_SCORE_OFFSET_Y );
|
pCourseScoreRowItem->m_textStepsScore[d].SetXY( COURSE_SCORE_OFFSET_X(d), COURSE_SCORE_OFFSET_Y );
|
||||||
pStepsCourseRowItems->m_textStepsScore[d].SetUseZBuffer( true );
|
pCourseScoreRowItem->m_textStepsScore[d].SetUseZBuffer( true );
|
||||||
pStepsCourseRowItems->m_textStepsScore[d].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
pCourseScoreRowItem->m_textStepsScore[d].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
ON_COMMAND( pStepsCourseRowItems->m_textStepsScore[d] );
|
ON_COMMAND( pCourseScoreRowItem->m_textStepsScore[d] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,11 +760,10 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
{
|
{
|
||||||
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
||||||
|
|
||||||
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
for( unsigned s=0; s<m_vpStepsScoreRowItem.size(); s++ )
|
||||||
for( unsigned s=0; s<num_songs; s++ )
|
|
||||||
{
|
{
|
||||||
const Song* pSong = SONGMAN->GetAllSongs()[s];
|
|
||||||
StepsScoreRowItem *pStepsScoreRowItem = m_vpStepsScoreRowItem[s];
|
StepsScoreRowItem *pStepsScoreRowItem = m_vpStepsScoreRowItem[s];
|
||||||
|
const Song* pSong = pStepsScoreRowItem->m_pSong;
|
||||||
|
|
||||||
pStepsScoreRowItem->m_textSongTitle.SetText( pSong->GetFullDisplayTitle() );
|
pStepsScoreRowItem->m_textSongTitle.SetText( pSong->GetFullDisplayTitle() );
|
||||||
|
|
||||||
@@ -800,12 +806,10 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
{
|
{
|
||||||
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
||||||
|
|
||||||
vector<Course*> courses;
|
for( unsigned c=0; c<m_vpCourseScoreRowItem.size(); c++ )
|
||||||
SONGMAN->GetAllCourses( courses, false );
|
|
||||||
for( unsigned c=0; c<courses.size(); c++ )
|
|
||||||
{
|
{
|
||||||
const Course* pCourse = courses[c];
|
CourseScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[c];
|
||||||
StepsScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[c];
|
const Course* pCourse = pCourseScoreRowItem->m_pCourse;
|
||||||
|
|
||||||
pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->m_sName );
|
pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->m_sName );
|
||||||
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
||||||
@@ -857,16 +861,17 @@ void ScreenRanking::TweenPageOffScreen()
|
|||||||
OFF_COMMAND( m_textPoints[l] );
|
OFF_COMMAND( m_textPoints[l] );
|
||||||
OFF_COMMAND( m_textTime[l] );
|
OFF_COMMAND( m_textTime[l] );
|
||||||
}
|
}
|
||||||
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
|
||||||
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
||||||
{
|
{
|
||||||
if( !m_sprDifficulty[*dc_iter].GetHidden() )
|
if( !m_sprDifficulty[*dc_iter].GetHidden() )
|
||||||
OFF_COMMAND( m_sprDifficulty[*dc_iter] );
|
OFF_COMMAND( m_sprDifficulty[*dc_iter] );
|
||||||
for( unsigned s=0; s<num_songs; s++ )
|
|
||||||
{
|
|
||||||
// m_vpTextStepsScore[*dc_iter][s];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
for( int d=0; d<NUM_COURSE_DIFFICULTIES; d++ )
|
||||||
|
{
|
||||||
|
if( !m_sprCourseDifficulty[d].GetHidden() )
|
||||||
|
OFF_COMMAND( m_sprCourseDifficulty[d] );
|
||||||
|
}
|
||||||
|
|
||||||
if( !m_ListScoreRowItems.GetHidden() )
|
if( !m_ListScoreRowItems.GetHidden() )
|
||||||
OFF_COMMAND( m_ListScoreRowItems );
|
OFF_COMMAND( m_ListScoreRowItems );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ protected:
|
|||||||
Sprite m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps
|
Sprite m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps
|
||||||
struct StepsScoreRowItem : public ActorFrame // for all_steps
|
struct StepsScoreRowItem : public ActorFrame // for all_steps
|
||||||
{
|
{
|
||||||
|
Song *m_pSong;
|
||||||
Sprite m_sprSongFrame;
|
Sprite m_sprSongFrame;
|
||||||
BitmapText m_textSongTitle;
|
BitmapText m_textSongTitle;
|
||||||
BitmapText m_textStepsScore[NUM_DIFFICULTIES];
|
BitmapText m_textStepsScore[NUM_DIFFICULTIES];
|
||||||
@@ -66,7 +67,14 @@ protected:
|
|||||||
vector<StepsScoreRowItem*> m_vpStepsScoreRowItem; // for all_steps
|
vector<StepsScoreRowItem*> m_vpStepsScoreRowItem; // for all_steps
|
||||||
ListDisplay m_ListScoreRowItems;
|
ListDisplay m_ListScoreRowItems;
|
||||||
Sprite m_sprCourseDifficulty[NUM_DIFFICULTIES]; // for all_courses
|
Sprite m_sprCourseDifficulty[NUM_DIFFICULTIES]; // for all_courses
|
||||||
vector<StepsScoreRowItem*> m_vpCourseScoreRowItem; // for all_courses
|
struct CourseScoreRowItem : public ActorFrame // for all_steps
|
||||||
|
{
|
||||||
|
Course *m_pCourse;
|
||||||
|
Sprite m_sprSongFrame;
|
||||||
|
BitmapText m_textSongTitle;
|
||||||
|
BitmapText m_textStepsScore[NUM_DIFFICULTIES];
|
||||||
|
};
|
||||||
|
vector<CourseScoreRowItem*> m_vpCourseScoreRowItem; // for all_courses
|
||||||
ListDisplay m_ListCourseRowItems;
|
ListDisplay m_ListCourseRowItems;
|
||||||
|
|
||||||
vector<PageToShow> m_vPagesToShow;
|
vector<PageToShow> m_vPagesToShow;
|
||||||
|
|||||||
Reference in New Issue
Block a user