updated scrolling text and icons to handle inexistant unlocks
This commit is contained in:
@@ -56,14 +56,17 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
ssprintf("Unlock%dSong", i)).c_str() );
|
ssprintf("Unlock%dSong", i)).c_str() );
|
||||||
|
|
||||||
if( pSong == NULL)
|
if( pSong == NULL)
|
||||||
|
{
|
||||||
|
LOG->Trace("Can't find song");
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
entry->Command(IconCommand);
|
entry->Command(IconCommand);
|
||||||
|
|
||||||
Unlocks.push_back(entry);
|
Unlocks.push_back(entry);
|
||||||
|
|
||||||
if ( !pSong->isLocked )
|
if ( !pSong->isLocked )
|
||||||
this->AddChild(Unlocks[i-1]);
|
this->AddChild(Unlocks[Unlocks.size() - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrolling text
|
// scrolling text
|
||||||
@@ -96,15 +99,24 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
if (pSong != NULL && pSong->ActualSong != NULL)
|
if (pSong != NULL && pSong->ActualSong != NULL)
|
||||||
SongText = pSong->ActualSong->GetFullDisplayTitle();
|
SongText = pSong->ActualSong->GetFullDisplayTitle();
|
||||||
else // song is missing
|
else // song is missing
|
||||||
text->Command("Diffuse,1,0,0,1");
|
{
|
||||||
|
if (SONGMAN->FindCourse(SongText) != NULL)
|
||||||
|
text->Command("Diffuse,0,1,0,1");
|
||||||
|
else
|
||||||
|
text->Command("Diffuse,0.5,0,0,1");
|
||||||
|
}
|
||||||
|
|
||||||
BreakLine(SongText);
|
BreakLine(SongText);
|
||||||
text->SetZoom(ScrollingTextZoom);
|
text->SetZoom(ScrollingTextZoom);
|
||||||
text->SetTextMaxWidth(MaxWidth, SongText );
|
text->SetTextMaxWidth(MaxWidth, SongText );
|
||||||
|
|
||||||
if (pSong->isLocked) {
|
if (pSong != NULL && pSong->isLocked) {
|
||||||
text->SetText("????????");
|
text->SetText("???");
|
||||||
text->SetZoom(ScrollingTextZoom * 1.99); }
|
// text->SetZoom(ScrollingTextZoom * 1.99);
|
||||||
|
} else if (pSong != NULL) {
|
||||||
|
RageColor color = SONGMAN->GetGroupColor(pSong->ActualSong->m_sGroupName);
|
||||||
|
text->SetGlobalDiffuseColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
text->SetXY(ScrollingTextX, ScrollingTextStartY);
|
text->SetXY(ScrollingTextX, ScrollingTextStartY);
|
||||||
text->Command( ssprintf("diffusealpha,0;sleep,%f;linear,0.5;diffusealpha,1;linear,%f;y,%f;linear,0.5;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) );
|
text->Command( ssprintf("diffusealpha,0;sleep,%f;linear,0.5;diffusealpha,1;linear,%f;y,%f;linear,0.5;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) );
|
||||||
@@ -133,6 +145,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
ItemIcons.push_back(IconCount);
|
ItemIcons.push_back(IconCount);
|
||||||
|
|
||||||
this->AddChild(ItemIcons[i-1]);
|
this->AddChild(ItemIcons[i-1]);
|
||||||
|
LOG->Trace("Added unlock text %d", i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,6 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
|
|
||||||
#define NUM_UNLOCKS 30
|
|
||||||
|
|
||||||
class Course;
|
class Course;
|
||||||
|
|
||||||
class ScreenUnlock : public ScreenAttract
|
class ScreenUnlock : public ScreenAttract
|
||||||
|
|||||||
@@ -1078,3 +1078,13 @@ Song *SongManager::FindSong( CString sGroup, CString sSong )
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Course *SongManager::FindCourse( CString sName )
|
||||||
|
{
|
||||||
|
for( unsigned i = 0; i < m_pCourses.size(); i++ )
|
||||||
|
{
|
||||||
|
if( sName.CompareNoCase(m_pCourses[i]->m_sName) )
|
||||||
|
return m_pCourses[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
@@ -61,6 +61,7 @@ public:
|
|||||||
void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,"",iMaxStages); }
|
void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,"",iMaxStages); }
|
||||||
void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,"",100000 /*inf*/ ); }
|
void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,"",100000 /*inf*/ ); }
|
||||||
Song *FindSong( CString sGroup, CString sSong );
|
Song *FindSong( CString sGroup, CString sSong );
|
||||||
|
Course *FindCourse( CString sName );
|
||||||
int GetNumSongs() const;
|
int GetNumSongs() const;
|
||||||
int GetNumGroups() const;
|
int GetNumGroups() const;
|
||||||
int GetNumCourses() const;
|
int GetNumCourses() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user