remove m_bAutoColorTicks. It's no longer useful now that the coloring is done with actor commands
This commit is contained in:
@@ -51,23 +51,15 @@ void DifficultyMeter::Load( const RString &sType )
|
|||||||
m_bShowDifficulty.Load(sType,"ShowDifficulty");
|
m_bShowDifficulty.Load(sType,"ShowDifficulty");
|
||||||
m_bShowMeter.Load(sType,"ShowMeter");
|
m_bShowMeter.Load(sType,"ShowMeter");
|
||||||
m_bShowEditDescription.Load(sType,"ShowEditDescription");
|
m_bShowEditDescription.Load(sType,"ShowEditDescription");
|
||||||
m_bAutoColorTicks.Load(sType,"AutoColorTicks");
|
|
||||||
m_sZeroMeterString.Load(sType,"ZeroMeterString");
|
m_sZeroMeterString.Load(sType,"ZeroMeterString");
|
||||||
|
|
||||||
if( m_bShowTicks )
|
if( m_bShowTicks )
|
||||||
{
|
{
|
||||||
m_textTicks.SetName( "Ticks" );
|
m_textTicks.SetName( "Ticks" );
|
||||||
RString sChars;
|
RString sChars;
|
||||||
if( !m_bAutoColorTicks )
|
for( unsigned i = 0; i < NUM_Difficulty; ++i )
|
||||||
{
|
sChars += char(i + '0'); // 01234
|
||||||
for( unsigned i = 0; i < NUM_Difficulty; ++i )
|
sChars += 'X'; // Off
|
||||||
sChars += char(i + '0'); // 01234
|
|
||||||
sChars += 'X'; // Off
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sChars = "0X";
|
|
||||||
}
|
|
||||||
m_textTicks.LoadFromTextureAndChars( THEME->GetPathF(sType,"ticks"), sChars );
|
m_textTicks.LoadFromTextureAndChars( THEME->GetPathF(sType,"ticks"), sChars );
|
||||||
ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTicks, sType );
|
ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textTicks, sType );
|
||||||
this->AddChild( &m_textTicks );
|
this->AddChild( &m_textTicks );
|
||||||
@@ -180,28 +172,26 @@ void DifficultyMeter::SetFromStepsTypeAndMeterAndCourseDifficulty( StepsType st,
|
|||||||
|
|
||||||
void DifficultyMeter::SetInternal( const SetParams ¶ms )
|
void DifficultyMeter::SetInternal( const SetParams ¶ms )
|
||||||
{
|
{
|
||||||
|
Message msg( "Set" );
|
||||||
|
msg.SetParam( "Meter", params.iMeter );
|
||||||
|
msg.SetParam( "StepsType", params.st );
|
||||||
|
msg.SetParam( "Difficulty", params.dc );
|
||||||
|
msg.SetParam( "IsCourseDifficulty", params.bIsCourseDifficulty );
|
||||||
|
msg.SetParam( "EditDescription", params.sEditDescription );
|
||||||
|
|
||||||
|
|
||||||
if( m_bShowTicks )
|
if( m_bShowTicks )
|
||||||
{
|
{
|
||||||
char on = '0';
|
char on = char(params.dc + '0');
|
||||||
char off = 'X';
|
char off = 'X';
|
||||||
if( !m_bAutoColorTicks )
|
|
||||||
on = char(params.dc + '0');
|
|
||||||
|
|
||||||
RString sNewText;
|
RString sNewText;
|
||||||
int iNumOn = min( (int)m_iMaxTicks, params.iMeter );
|
int iNumOn = min( (int)m_iMaxTicks, params.iMeter );
|
||||||
sNewText.insert( sNewText.end(), iNumOn, on );
|
sNewText.insert( sNewText.end(), iNumOn, on );
|
||||||
int iNumOff = max( 0, m_iNumTicks-iNumOn );
|
int iNumOff = max( 0, m_iNumTicks-iNumOn );
|
||||||
sNewText.insert( sNewText.end(), iNumOff, off );
|
sNewText.insert( sNewText.end(), iNumOff, off );
|
||||||
|
|
||||||
Lua *L = LUA->Get();
|
|
||||||
LuaHelpers::Push( L, params.dc );
|
|
||||||
m_textTicks.m_pLuaInstance->Set( L, "Difficulty" );
|
|
||||||
LuaHelpers::Push( L, params.iMeter );
|
|
||||||
m_textTicks.m_pLuaInstance->Set( L, "Meter" );
|
|
||||||
LUA->Release(L);
|
|
||||||
m_textTicks.PlayCommand( "DifficultyChanged" );
|
|
||||||
|
|
||||||
m_textTicks.SetText( sNewText );
|
m_textTicks.SetText( sNewText );
|
||||||
|
m_textTicks.HandleMessage( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_bShowMeter )
|
if( m_bShowMeter )
|
||||||
@@ -216,7 +206,7 @@ void DifficultyMeter::SetInternal( const SetParams ¶ms )
|
|||||||
m_textMeter.SetText( sMeter );
|
m_textMeter.SetText( sMeter );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_textMeter.PlayCommand( "TextChanged" );
|
m_textMeter.HandleMessage( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_bShowEditDescription )
|
if( m_bShowEditDescription )
|
||||||
@@ -230,15 +220,9 @@ void DifficultyMeter::SetInternal( const SetParams ¶ms )
|
|||||||
{
|
{
|
||||||
m_textEditDescription.SetVisible( false );
|
m_textEditDescription.SetVisible( false );
|
||||||
}
|
}
|
||||||
|
m_textEditDescription.HandleMessage( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
Message msg( "Set" );
|
|
||||||
msg.SetParam( "Meter", params.iMeter );
|
|
||||||
msg.SetParam( "StepsType", params.st );
|
|
||||||
msg.SetParam( "Difficulty", params.dc );
|
|
||||||
msg.SetParam( "IsCourseDifficulty", params.bIsCourseDifficulty );
|
|
||||||
msg.SetParam( "EditDescription", params.sEditDescription );
|
|
||||||
|
|
||||||
if( m_bShowDifficulty )
|
if( m_bShowDifficulty )
|
||||||
m_Difficulty->HandleMessage( msg );
|
m_Difficulty->HandleMessage( msg );
|
||||||
if( m_bShowMeter )
|
if( m_bShowMeter )
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ private:
|
|||||||
ThemeMetric<bool> m_bShowDifficulty;
|
ThemeMetric<bool> m_bShowDifficulty;
|
||||||
ThemeMetric<bool> m_bShowMeter;
|
ThemeMetric<bool> m_bShowMeter;
|
||||||
ThemeMetric<bool> m_bShowEditDescription;
|
ThemeMetric<bool> m_bShowEditDescription;
|
||||||
ThemeMetric<bool> m_bAutoColorTicks;
|
|
||||||
ThemeMetric<RString> m_sZeroMeterString;
|
ThemeMetric<RString> m_sZeroMeterString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user