[PercentageDisplay] Remove unused ApplyScoreDisplayOptions metric, added PercentFormat and RemainderFormat metrics.

This commit is contained in:
AJ Kelly
2012-01-05 21:47:42 -06:00
parent 1e0bec5ea8
commit 24f86b2532
3 changed files with 13 additions and 8 deletions
+4
View File
@@ -634,6 +634,7 @@ PercentUseRemainder=false
ApplyScoreDisplayOptions=true
DancePointsDigits=5
#
PercentFormat="%2d"
PercentP1X=0
PercentP1Y=0
PercentP1OnCommand=zoom,0.7;shadowlength,0;diffuse,PlayerColor(PLAYER_1)
@@ -1172,6 +1173,7 @@ DeltaSecondsHeldCommand=
DeltaSecondsGainLifeCommand=
[ScoreDisplayPercentage Percent]
PercentFormat="%2d"
PercentP1X=0
PercentP1Y=0
PercentP1OnCommand=shadowlength,0;diffuse,PlayerColor(PLAYER_1)
@@ -1235,6 +1237,7 @@ LevelP2OffCommand=
AttackDurationSeconds=3.0
[ScreenEvaluation Percent]
PercentFormat="%2d"
PercentP1X=0
PercentP1Y=0
PercentP1OnCommand=horizalign,right;vertalign,bottom;glowshift;effectperiod,2;shadowlength,0
@@ -1243,6 +1246,7 @@ PercentP2X=0
PercentP2Y=0
PercentP2OnCommand=horizalign,right;vertalign,bottom;glowshift;effectperiod,2;shadowlength,0
PercentP2OffCommand=
RemainderFormat=".%02d%%"
PercentRemainderP1X=0
PercentRemainderP1Y=0
PercentRemainderP1OnCommand=horizalign,left;vertalign,bottom;glowshift;effectperiod,2;shadowlength,0
+5 -5
View File
@@ -23,7 +23,6 @@ PercentageDisplay::PercentageDisplay()
m_LastMax = -1;
m_iDancePointsDigits = 0;
m_bUseRemainder = false;
m_bApplyScoreDisplayOptions = false;
m_bAutoRefresh = false;
m_FormatPercentScore.SetFromExpression( "FormatPercentScore" );
}
@@ -31,7 +30,6 @@ PercentageDisplay::PercentageDisplay()
void PercentageDisplay::LoadFromNode( const XNode* pNode )
{
pNode->GetAttrValue( "DancePointsDigits", m_iDancePointsDigits );
pNode->GetAttrValue( "ApplyScoreDisplayOptions", m_bApplyScoreDisplayOptions );
pNode->GetAttrValue( "AutoRefresh", m_bAutoRefresh );
{
Lua *L = LUA->Get();
@@ -76,9 +74,11 @@ void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStage
m_iDancePointsDigits = THEME->GetMetricI( sMetricsGroup, "DancePointsDigits" );
m_bUseRemainder = THEME->GetMetricB( sMetricsGroup, "PercentUseRemainder" );
m_bApplyScoreDisplayOptions = THEME->GetMetricB( sMetricsGroup, "ApplyScoreDisplayOptions" );
m_FormatPercentScore = THEME->GetMetricR( sMetricsGroup, "Format" );
m_sPercentFormat = THEME->GetMetric( sMetricsGroup, "PercentFormat" );
m_sRemainderFormat = THEME->GetMetric( sMetricsGroup, "RemainderFormat" );
if( m_FormatPercentScore.IsNil() )
{
LOG->Trace( "Format is nil in [%s]. Defaulting to 'FormatPercentScore'.", sMetricsGroup.c_str() );
@@ -145,8 +145,8 @@ void PercentageDisplay::Refresh()
{
int iPercentWhole = int(fPercentDancePoints*100);
int iPercentRemainder = int( (fPercentDancePoints*100 - int(fPercentDancePoints*100)) * 10 );
sNumToDisplay = ssprintf( "%2d", iPercentWhole );
m_textPercentRemainder.SetText( ssprintf(".%01d%%", iPercentRemainder) );
sNumToDisplay = ssprintf( m_sPercentFormat, iPercentWhole );
m_textPercentRemainder.SetText( ssprintf(m_sRemainderFormat, iPercentRemainder) );
}
else
{
+2 -1
View File
@@ -28,7 +28,6 @@ public:
private:
int m_iDancePointsDigits;
bool m_bUseRemainder;
bool m_bApplyScoreDisplayOptions;
void Refresh();
const PlayerState *m_pPlayerState;
@@ -38,6 +37,8 @@ private:
int m_LastMax;
BitmapText m_textPercent;
BitmapText m_textPercentRemainder;
RString m_sPercentFormat;
RString m_sRemainderFormat;
LuaReference m_FormatPercentScore;
};