support extreme-style unlock info display
This commit is contained in:
@@ -27,7 +27,6 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
|
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
|
||||||
|
|
||||||
// get unlock data first
|
// get unlock data first
|
||||||
// GAMESTATE->m_pUnlockingSys->LoadFromDATFile("Data\\MemCard.ini");
|
|
||||||
|
|
||||||
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->DancePointsUntilNextUnlock() );
|
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->DancePointsUntilNextUnlock() );
|
||||||
CString sAP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->ArcadePointsUntilNextUnlock() );
|
CString sAP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->ArcadePointsUntilNextUnlock() );
|
||||||
@@ -39,12 +38,14 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
|
|
||||||
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
for(int i=1; i <= THEME->GetMetricI("ScreenUnlock", "NumUnlocks"); i++)
|
||||||
{
|
{
|
||||||
|
Sprite* entry = new Sprite;
|
||||||
|
|
||||||
// new unlock graphic
|
// new unlock graphic
|
||||||
Unlocks[i].Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );
|
entry->Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );
|
||||||
|
|
||||||
// set graphic location
|
// set graphic location
|
||||||
Unlocks[i].SetName( ssprintf("Unlock%d",i) );
|
entry->SetName( ssprintf("Unlock%d",i) );
|
||||||
SET_XY( Unlocks[i] );
|
SET_XY( *entry );
|
||||||
|
|
||||||
// get pertaining songentry
|
// get pertaining songentry
|
||||||
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindSong(
|
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindSong(
|
||||||
@@ -57,10 +58,12 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
if( pSong == NULL)
|
if( pSong == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Unlocks[i].Command(IconCommand);
|
entry->Command(IconCommand);
|
||||||
|
|
||||||
|
Unlocks.push_back(entry);
|
||||||
|
|
||||||
if ( !pSong->isLocked )
|
if ( !pSong->isLocked )
|
||||||
this->AddChild(&Unlocks[i]);
|
this->AddChild(Unlocks[i-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrolling text
|
// scrolling text
|
||||||
@@ -81,46 +84,57 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
|
|
||||||
for(int i = 1; i <= NumberUnlocks; i++)
|
for(int i = 1; i <= NumberUnlocks; i++)
|
||||||
{
|
{
|
||||||
item[i].LoadFromFont( THEME->GetPathToF("_shared2") );
|
BitmapText* text = new BitmapText;
|
||||||
item[i].SetHorizAlign( Actor::align_left );
|
|
||||||
|
|
||||||
CString SongText = THEME->GetMetric("ScreenUnlock",
|
text->LoadFromFont( THEME->GetPathToF("_shared2") );
|
||||||
ssprintf("Unlock%dSong", i));
|
text->SetHorizAlign( Actor::align_left );
|
||||||
|
|
||||||
|
CString SongText = THEME->GetMetric("ScreenUnlock", ssprintf("Unlock%dSong", i));
|
||||||
SongText.MakeUpper();
|
SongText.MakeUpper();
|
||||||
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindSong(SongText);
|
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindSong(SongText);
|
||||||
|
|
||||||
if (pSong != NULL && pSong->ActualSong != NULL)
|
if (pSong != NULL && pSong->ActualSong != NULL)
|
||||||
{
|
|
||||||
LOG->Trace("Entry %d, pointer=%d", i, (int)pSong);
|
|
||||||
SongText = pSong->ActualSong->GetFullDisplayTitle();
|
SongText = pSong->ActualSong->GetFullDisplayTitle();
|
||||||
}
|
else // song is missing
|
||||||
else if (pSong == NULL) // song is not in library
|
text->Command("Diffuse,1,0,0,1");
|
||||||
item[i].Command("Diffuse,0,1,0,1");
|
|
||||||
else // song is mistyped
|
|
||||||
item[i].Command("Diffuse,1,0,0,1");
|
|
||||||
|
|
||||||
BreakLine(SongText);
|
BreakLine(SongText);
|
||||||
|
text->SetZoom(ScrollingTextZoom);
|
||||||
|
text->SetTextMaxWidth(MaxWidth, SongText );
|
||||||
|
|
||||||
item[i].SetZoom(ScrollingTextZoom);
|
if (pSong->isLocked) {
|
||||||
item[i].SetTextMaxWidth(MaxWidth, SongText );
|
text->SetText("????????");
|
||||||
|
text->SetZoom(ScrollingTextZoom * 1.99); }
|
||||||
|
|
||||||
if (pSong->isLocked)
|
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) );
|
||||||
|
|
||||||
|
item.push_back(text);
|
||||||
|
this->AddChild(item[i-1]);
|
||||||
|
|
||||||
|
if (THEME->GetMetricI("ScreenUnlock", "UnlockTextScroll") == 2)
|
||||||
{
|
{
|
||||||
item[i].SetText("????????");
|
Sprite* IconCount = new Sprite;
|
||||||
item[i].SetZoom(ScrollingTextZoom * 1.99);
|
|
||||||
|
// new unlock graphic
|
||||||
|
IconCount->Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", i)) );
|
||||||
|
|
||||||
|
// set graphic location
|
||||||
|
IconCount->SetXY( THEME->GetMetricF("ScreenUnlock", "UnlockTextScrollIconX"),
|
||||||
|
ScrollingTextStartY);
|
||||||
|
|
||||||
|
float IconSize = THEME->GetMetricF("ScreenUnlock", "UnlockTextScrollIconSize");
|
||||||
|
|
||||||
|
IconCount->SetHeight(IconSize);
|
||||||
|
IconCount->SetWidth(IconSize);
|
||||||
|
|
||||||
|
IconCount->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) );
|
||||||
|
|
||||||
|
ItemIcons.push_back(IconCount);
|
||||||
|
|
||||||
|
this->AddChild(ItemIcons[i-1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
item[i].SetXY(ScrollingTextX, ScrollingTextStartY);
|
|
||||||
|
|
||||||
CString commands;
|
|
||||||
|
|
||||||
commands = 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);
|
|
||||||
|
|
||||||
LOG->Trace("Updated text %d: %s", i, SongText.c_str() );
|
|
||||||
|
|
||||||
item[i].Command(commands);
|
|
||||||
this->AddChild(&item[i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ public:
|
|||||||
ScreenUnlock();
|
ScreenUnlock();
|
||||||
protected:
|
protected:
|
||||||
BitmapText PointsUntilNextUnlock;
|
BitmapText PointsUntilNextUnlock;
|
||||||
Sprite Unlocks[NUM_UNLOCKS]; // support 30 unlocks right now
|
vector<Sprite*> Unlocks;
|
||||||
BitmapText item[NUM_UNLOCKS]; // for scrolling text
|
vector<BitmapText*> item; // scrolling text
|
||||||
|
vector<Sprite*> ItemIcons; // icons for scrolling text
|
||||||
|
|
||||||
void BreakLine(CString& line); // used in scrollingtext
|
void BreakLine(CString& line); // used in scrollingtext
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user