This commit is contained in:
Andrew Wong
2003-08-06 13:53:40 +00:00
parent 6afc47e2dc
commit ee7ae2aba9
+19 -30
View File
@@ -55,14 +55,8 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") ); PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left ); PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
// get unlock data first
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->DancePointsUntilNextUnlock() );
CString sAP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->ArcadePointsUntilNextUnlock() );
CString sSP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->SongPointsUntilNextUnlock() );
CString IconCommand = ICON_COMMAND;
int i; int i;
CString IconCommand = ICON_COMMAND;
for(i=1; i <= NumUnlocks; i++) for(i=1; i <= NumUnlocks; i++)
{ {
Sprite* entry = new Sprite; Sprite* entry = new Sprite;
@@ -91,7 +85,6 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
} }
entry->Command(IconCommand); entry->Command(IconCommand);
Unlocks.push_back(entry); Unlocks.push_back(entry);
if ( !pSong->isLocked ) if ( !pSong->isLocked )
@@ -101,7 +94,6 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
// scrolling text // scrolling text
if (UNLOCK_TEXT_SCROLL != 0) if (UNLOCK_TEXT_SCROLL != 0)
{ {
int NumberUnlocks = NumUnlocks;
float ScrollingTextX = UNLOCK_TEXT_SCROLL_X; float ScrollingTextX = UNLOCK_TEXT_SCROLL_X;
float ScrollingTextStartY = UNLOCK_TEXT_SCROLL_START_Y; float ScrollingTextStartY = UNLOCK_TEXT_SCROLL_START_Y;
float ScrollingTextEndY = UNLOCK_TEXT_SCROLL_END_Y; float ScrollingTextEndY = UNLOCK_TEXT_SCROLL_END_Y;
@@ -116,11 +108,11 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
float SECS_PER_CYCLE = 0; float SECS_PER_CYCLE = 0;
if (UNLOCK_TEXT_SCROLL != 3) if (UNLOCK_TEXT_SCROLL != 3)
SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows + NumberUnlocks); SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows + NumUnlocks);
else else
SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows * 3 + NumberUnlocks + 4); SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows * 3 + NumUnlocks + 4);
for(i = 1; i <= NumberUnlocks; i++) for(i = 1; i <= NumUnlocks; i++)
{ {
BitmapText* text = new BitmapText; BitmapText* text = new BitmapText;
@@ -129,15 +121,12 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
CString DisplayedSong = DISPLAYED_SONG(i); CString DisplayedSong = DISPLAYED_SONG(i);
if (USE_UNLOCKS_DAT == 1) if (USE_UNLOCKS_DAT == 1)
{
if ((unsigned)i <= GAMESTATE->m_pUnlockingSys->m_SongEntries.size() ) if ((unsigned)i <= GAMESTATE->m_pUnlockingSys->m_SongEntries.size() )
DisplayedSong = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName; DisplayedSong = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName;
}
DisplayedSong.MakeUpper(); DisplayedSong.MakeUpper();
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong);
if ( pSong == NULL ) if ( pSong == NULL ) // no such song
continue; continue;
/* Reset zoom before using SetTextMaxWidth. */ /* Reset zoom before using SetTextMaxWidth. */
@@ -151,7 +140,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
title = title + "\n" + subtitle; title = title + "\n" + subtitle;
text->SetTextMaxWidth( MaxWidth, title ); text->SetTextMaxWidth( MaxWidth, title );
} }
else // song is missing else // song is missing, might be a course
{ {
Course *crs = SONGMAN->FindCourse( DisplayedSong ); Course *crs = SONGMAN->FindCourse( DisplayedSong );
if (crs != NULL) if (crs != NULL)
@@ -168,11 +157,11 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
if (pSong != NULL && pSong->m_pSong != NULL) if (pSong != NULL && pSong->m_pSong != NULL)
{ {
if( pSong->isLocked) if( pSong->isLocked) // song is locked
{ {
text->SetText("???"); text->SetText("???");
text->SetZoomX(1); text->SetZoomX(1);
} else { } else { // song is unlocked, change color
RageColor color = SONGMAN->GetGroupColor(pSong->m_pSong->m_sGroupName); RageColor color = SONGMAN->GetGroupColor(pSong->m_pSong->m_sGroupName);
text->SetGlobalDiffuseColor(color); text->SetGlobalDiffuseColor(color);
} }
@@ -181,7 +170,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
text->SetXY(ScrollingTextX, ScrollingTextStartY); text->SetXY(ScrollingTextX, ScrollingTextStartY);
if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NumUnlocks) if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NumUnlocks)
{ { // special command for last unlocks when extreme-style scrolling is in effect
float TargetRow = -0.5f + i + UNLOCK_TEXT_SCROLL_ROWS - NumUnlocks; float TargetRow = -0.5f + i + UNLOCK_TEXT_SCROLL_ROWS - NumUnlocks;
float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY); float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY);
float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE; float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE;
@@ -236,16 +225,13 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
if (UNLOCK_TEXT_SCROLL == 3) if (UNLOCK_TEXT_SCROLL == 3)
{ {
int NumberUnlocks = NumUnlocks;
float ScrollingTextX = UNLOCK_TEXT_SCROLL_X; float ScrollingTextX = UNLOCK_TEXT_SCROLL_X;
float ScrollingTextStartY = UNLOCK_TEXT_SCROLL_START_Y; float ScrollingTextStartY = UNLOCK_TEXT_SCROLL_START_Y;
float ScrollingTextEndY = UNLOCK_TEXT_SCROLL_END_Y; float ScrollingTextEndY = UNLOCK_TEXT_SCROLL_END_Y;
// float ScrollingTextZoom = UNLOCK_TEXT_SCROLL_ZOOM;
float ScrollingTextRows = UNLOCK_TEXT_SCROLL_ROWS; float ScrollingTextRows = UNLOCK_TEXT_SCROLL_ROWS;
float MaxWidth = UNLOCK_TEXT_SCROLL_MAX_WIDTH; float MaxWidth = UNLOCK_TEXT_SCROLL_MAX_WIDTH;
float SecondsToScroll = TIME_TO_DISPLAY - 1; float SecondsToScroll = TIME_TO_DISPLAY - 1;
float SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows * 3 + NumberUnlocks + 4); float SECS_PER_CYCLE = (float)SecondsToScroll/(ScrollingTextRows * 3 + NumUnlocks + 4);
for(i=1; i <= UNLOCK_TEXT_SCROLL_ROWS; i++) for(i=1; i <= UNLOCK_TEXT_SCROLL_ROWS; i++)
{ {
@@ -292,7 +278,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
NewText->SetGlobalDiffuseColor(color); NewText->SetGlobalDiffuseColor(color);
NewText->SetXY(ScrollingTextX, ScrollingTextStartY); NewText->SetXY(ScrollingTextX, ScrollingTextStartY);
NewText->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumberUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )) ); NewText->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )) );
// new unlock graphic // new unlock graphic
NewIcon->Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", NextIcon)) ); NewIcon->Load( THEME->GetPathToG(ssprintf("ScreenUnlock %d icon", NextIcon)) );
@@ -303,7 +289,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
NewIcon->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE); NewIcon->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE);
NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE); NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE);
NewIcon->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumberUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )) ); NewIcon->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )) );
ItemIcons.push_back(NewIcon); ItemIcons.push_back(NewIcon);
item.push_back(NewText); item.push_back(NewText);
@@ -320,13 +306,16 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
CString PointDisplay = TYPE_TO_DISPLAY; CString PointDisplay = TYPE_TO_DISPLAY;
if (PointDisplay == "DP" || PointDisplay == "Dance") if (PointDisplay == "DP" || PointDisplay == "Dance")
{
CString sDP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->DancePointsUntilNextUnlock() );
PointsUntilNextUnlock.SetText( sDP ); PointsUntilNextUnlock.SetText( sDP );
} else if (PointDisplay == "AP" || PointDisplay == "Arcade") {
if (PointDisplay == "AP" || PointDisplay == "Arcade") CString sAP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->ArcadePointsUntilNextUnlock() );
PointsUntilNextUnlock.SetText( sAP ); PointsUntilNextUnlock.SetText( sAP );
} else if (PointDisplay == "SP" || PointDisplay == "Song") {
if (PointDisplay == "SP" || PointDisplay == "Song") CString sSP = ssprintf( "%d", (int)GAMESTATE->m_pUnlockingSys->SongPointsUntilNextUnlock() );
PointsUntilNextUnlock.SetText( sSP ); PointsUntilNextUnlock.SetText( sSP );
}
PointsUntilNextUnlock.SetZoom( POINTS_ZOOM ); PointsUntilNextUnlock.SetZoom( POINTS_ZOOM );
SET_XY( PointsUntilNextUnlock ); SET_XY( PointsUntilNextUnlock );