diff --git a/stepmania/src/ScreenUnlock.cpp b/stepmania/src/ScreenUnlock.cpp index 1455466291..758788d6cb 100644 --- a/stepmania/src/ScreenUnlock.cpp +++ b/stepmania/src/ScreenUnlock.cpp @@ -107,8 +107,6 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") { BitmapText* text = new BitmapText; - /* XXX: Don't load _shared directly. Instead, create a redir in the - * Fonts directory, eg. "ScreenUnlock text.redir", that points to it. */ text->LoadFromFont( THEME->GetPathToF("ScreenUnlock text") ); text->SetHorizAlign( Actor::align_left ); @@ -155,7 +153,19 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") } text->SetXY(ScrollingTextX, ScrollingTextStartY); - text->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) ); + + if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NUM_UNLOCKS) + { + float TargetRow = -0.5 + i + UNLOCK_TEXT_SCROLL_ROWS - NUM_UNLOCKS; + float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY); + float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE; + float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime; + LOG->Trace("Target Row: %f", TargetRow); + LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); + text->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY) ); + } + else + text->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;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) ); item.push_back(text); @@ -173,8 +183,19 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") IconCount->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE); IconCount->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE); - IconCount->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) ); -// 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) ); + if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NUM_UNLOCKS) + { + float TargetRow = -0.5 + i + UNLOCK_TEXT_SCROLL_ROWS - NUM_UNLOCKS; + float StopOffPoint = ScrollingTextEndY - TargetRow / UNLOCK_TEXT_SCROLL_ROWS * (ScrollingTextEndY - ScrollingTextStartY); + float FirstCycleTime = (UNLOCK_TEXT_SCROLL_ROWS - TargetRow) * SECS_PER_CYCLE; + float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime; + LOG->Trace("Target Row: %f", TargetRow); + LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); + IconCount->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY) ); + } + else + IconCount->Command( ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY) ); + // 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); diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index de8fd9d2a2..2ffedddada 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -429,7 +429,9 @@ float UnlockSystem::UnlockAddAP(Grade credit) float UnlockSystem::UnlockAddDP(float credit) { ReadValues("Data/MemCard.ini"); - DancePoints += credit; + + // we don't want to ever take away dance points + if (credit > 0) DancePoints += credit; WriteValues("Data/MemCard.ini"); return DancePoints;