Fixed a bug with "points till next unlock"

Implemented metrics for unlock screen (sets position and size of dance points till next unlock)
This commit is contained in:
Andrew Wong
2003-07-08 12:50:31 +00:00
parent 6fdfd55dba
commit d248bd17e3
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -6,6 +6,9 @@
#include "RageLog.h" #include "RageLog.h"
#include "UnlockSystem.h" #include "UnlockSystem.h"
ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
{ {
LOG->Trace("ScreenUnlock::ScreenUnlock()"); LOG->Trace("ScreenUnlock::ScreenUnlock()");
@@ -27,7 +30,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
}; };
PointsUntilNextUnlock.SetText( sDP ); PointsUntilNextUnlock.SetText( sDP );
PointsUntilNextUnlock.SetZoom( 3 ); PointsUntilNextUnlock.SetZoom( THEME->GetMetricF("ScreenUnlock","DancePointsZoom") );
PointsUntilNextUnlock.SetXY( 10, 370 ); PointsUntilNextUnlock.SetXY( THEME->GetMetricI("ScreenUnlock","DancePointsDisplayX"), THEME->GetMetricI("ScreenUnlock","DancePointsDisplayY") );
this->AddChild( &PointsUntilNextUnlock ); this->AddChild( &PointsUntilNextUnlock );
} }
+1
View File
@@ -287,6 +287,7 @@ float UnlockSystem::NumPointsUntilNextUnlock()
fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired); fSmallestPoints = min(fSmallestPoints, m_SongEntries[a].m_fDancePointsRequired);
} }
if (fSmallestPoints == 400000000) return 0; // no match found
return fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated; return fSmallestPoints - PREFSMAN->m_fDancePointsAccumulated;
} }