[BPMDisplay] Added FormatString metric.

This commit is contained in:
AJ Kelly
2011-02-19 03:34:58 -06:00
parent 1fd81cfe9c
commit c3e3cf3361
4 changed files with 13 additions and 4 deletions
+5 -1
View File
@@ -13,9 +13,13 @@ _____________________________________________________________________________
sm-ssc v1.2.2 | 201102??
--------------------------------------------------------------------------------
20110219
--------
* [BPMDisplay] Added FormatString metric. [AJ]
20110218
--------
* [WheelBase] Added SetOpenSection Lua binding [AJ]
* [WheelBase] Added SetOpenSection Lua binding. [AJ]
20110217
--------
+2
View File
@@ -218,6 +218,8 @@ QuestionMarksText="???"
RandomText="!!!"
# xxx: localize me -aj
VariousText="000"
FormatString="%03.0f"
[CodeDetector]
# Codes on the MusicWheel that change stuff!
PrevSteps1="Up,Up"
+4 -3
View File
@@ -38,6 +38,7 @@ void BPMDisplay::Load()
QUESTIONMARKS_TEXT.Load( m_sName, "QuestionMarksText" );
RANDOM_TEXT.Load( m_sName, "RandomText" );
VARIOUS_TEXT.Load( m_sName, "VariousText" );
BPM_FORMAT_STRING.Load( m_sName, "FormatString" );
RunCommands( SET_NORMAL_COMMAND );
}
@@ -76,9 +77,9 @@ void BPMDisplay::Update( float fDeltaTime )
{
m_fBPMFrom = -1;
if( (bool)SHOW_QMARKS )
SetText( (RandomFloat(0,1)>0.90f) ? (RString)QUESTIONMARKS_TEXT : ssprintf("%03.0f",RandomFloat(0,999)) );
SetText( (RandomFloat(0,1)>0.90f) ? (RString)QUESTIONMARKS_TEXT : ssprintf((RString)BPM_FORMAT_STRING,RandomFloat(0,999)) );
else
SetText( ssprintf("%03.0f",RandomFloat(0,999)) );
SetText( ssprintf((RString)BPM_FORMAT_STRING, RandomFloat(0,999)) );
}
else if(m_fBPMFrom == -1)
{
@@ -89,7 +90,7 @@ void BPMDisplay::Update( float fDeltaTime )
if( m_fBPMTo != -1)
{
const float fActualBPM = GetActiveBPM();
SetText( ssprintf("%03.0f", fActualBPM) );
SetText( ssprintf((RString)BPM_FORMAT_STRING, fActualBPM) );
}
}
+2
View File
@@ -94,6 +94,8 @@ protected:
ThemeMetric<RString> RANDOM_TEXT;
/** @brief The text used as one possible option for random BPM. */
ThemeMetric<RString> QUESTIONMARKS_TEXT;
/** @brief The format string used for the numbers. */
ThemeMetric<RString> BPM_FORMAT_STRING;
/** @brief The lowest valued BPM. */
float m_fBPMFrom;