show dance points in workout
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "StageStats.h"
|
#include "StageStats.h"
|
||||||
#include "PlayerState.h"
|
#include "PlayerState.h"
|
||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
|
#include "WorkoutManager.h"
|
||||||
|
|
||||||
|
|
||||||
REGISTER_ACTOR_CLASS( PercentageDisplay )
|
REGISTER_ACTOR_CLASS( PercentageDisplay )
|
||||||
@@ -48,7 +49,7 @@ void PercentageDisplay::LoadFromNode( const XNode* pNode )
|
|||||||
this->AddChild( &m_textPercent );
|
this->AddChild( &m_textPercent );
|
||||||
|
|
||||||
pChild = pNode->GetChild( "PercentRemainder" );
|
pChild = pNode->GetChild( "PercentRemainder" );
|
||||||
if( !PREFSMAN->m_bDancePointsForOni && pChild != NULL )
|
if( !ShowDancePointsNotPercentage() && pChild != NULL )
|
||||||
{
|
{
|
||||||
m_bUseRemainder = true;
|
m_bUseRemainder = true;
|
||||||
m_textPercentRemainder.LoadFromNode( pChild );
|
m_textPercentRemainder.LoadFromNode( pChild );
|
||||||
@@ -84,7 +85,7 @@ void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStage
|
|||||||
m_Format.SetFromExpression( "FormatPercentScore" );
|
m_Format.SetFromExpression( "FormatPercentScore" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( PREFSMAN->m_bDancePointsForOni )
|
if( ShowDancePointsNotPercentage() )
|
||||||
m_textPercent.SetName( "DancePoints" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
m_textPercent.SetName( "DancePoints" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
||||||
else
|
else
|
||||||
m_textPercent.SetName( "Percent" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
m_textPercent.SetName( "Percent" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
||||||
@@ -94,7 +95,7 @@ void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStage
|
|||||||
ActorUtil::LoadAllCommands( m_textPercent, sMetricsGroup );
|
ActorUtil::LoadAllCommands( m_textPercent, sMetricsGroup );
|
||||||
this->AddChild( &m_textPercent );
|
this->AddChild( &m_textPercent );
|
||||||
|
|
||||||
if( !PREFSMAN->m_bDancePointsForOni && m_bUseRemainder )
|
if( !ShowDancePointsNotPercentage() && m_bUseRemainder )
|
||||||
{
|
{
|
||||||
m_textPercentRemainder.SetName( "PercentRemainder" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
m_textPercentRemainder.SetName( "PercentRemainder" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );
|
||||||
m_textPercentRemainder.LoadFromFont( THEME->GetPathF(sMetricsGroup,"remainder") );
|
m_textPercentRemainder.LoadFromFont( THEME->GetPathF(sMetricsGroup,"remainder") );
|
||||||
@@ -129,7 +130,7 @@ void PercentageDisplay::Refresh()
|
|||||||
|
|
||||||
RString sNumToDisplay;
|
RString sNumToDisplay;
|
||||||
|
|
||||||
if( PREFSMAN->m_bDancePointsForOni )
|
if( ShowDancePointsNotPercentage() )
|
||||||
{
|
{
|
||||||
sNumToDisplay = ssprintf( "%*d", m_iDancePointsDigits, max( 0, iActualDancePoints ) );
|
sNumToDisplay = ssprintf( "%*d", m_iDancePointsDigits, max( 0, iActualDancePoints ) );
|
||||||
}
|
}
|
||||||
@@ -187,6 +188,12 @@ void PercentageDisplay::Refresh()
|
|||||||
m_textPercent.SetText( sNumToDisplay );
|
m_textPercent.SetText( sNumToDisplay );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PercentageDisplay::ShowDancePointsNotPercentage() const
|
||||||
|
{
|
||||||
|
// Use staight dance points in workout because the percentage denominator isn't accurate - we don't know when the players are going to stop.
|
||||||
|
return (WORKOUTMAN->m_pCurWorkout != NULL) || PREFSMAN->m_bDancePointsForOni;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ public:
|
|||||||
virtual void LoadFromNode( const XNode* pNode );
|
virtual void LoadFromNode( const XNode* pNode );
|
||||||
virtual PercentageDisplay *Copy() const;
|
virtual PercentageDisplay *Copy() const;
|
||||||
|
|
||||||
|
bool ShowDancePointsNotPercentage() const;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Lua
|
// Lua
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user