unlock system changes - mainly to try implement extreme-style unlock scrolling
This commit is contained in:
@@ -107,8 +107,6 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
{
|
{
|
||||||
BitmapText* text = new BitmapText;
|
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->LoadFromFont( THEME->GetPathToF("ScreenUnlock text") );
|
||||||
text->SetHorizAlign( Actor::align_left );
|
text->SetHorizAlign( Actor::align_left );
|
||||||
|
|
||||||
@@ -155,7 +153,19 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
}
|
}
|
||||||
|
|
||||||
text->SetXY(ScrollingTextX, ScrollingTextStartY);
|
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) );
|
// 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);
|
item.push_back(text);
|
||||||
@@ -173,8 +183,19 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
|
|||||||
IconCount->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE);
|
IconCount->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE);
|
||||||
IconCount->SetWidth(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) );
|
if (UNLOCK_TEXT_SCROLL == 3 && UNLOCK_TEXT_SCROLL_ROWS + i > NUM_UNLOCKS)
|
||||||
// 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) );
|
{
|
||||||
|
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);
|
ItemIcons.push_back(IconCount);
|
||||||
|
|
||||||
|
|||||||
@@ -429,7 +429,9 @@ float UnlockSystem::UnlockAddAP(Grade credit)
|
|||||||
float UnlockSystem::UnlockAddDP(float credit)
|
float UnlockSystem::UnlockAddDP(float credit)
|
||||||
{
|
{
|
||||||
ReadValues("Data/MemCard.ini");
|
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");
|
WriteValues("Data/MemCard.ini");
|
||||||
|
|
||||||
return DancePoints;
|
return DancePoints;
|
||||||
|
|||||||
Reference in New Issue
Block a user