diff --git a/stepmania/src/DifficultyList.h b/stepmania/src/DifficultyList.h index c2c0238f73..2a506aa736 100644 --- a/stepmania/src/DifficultyList.h +++ b/stepmania/src/DifficultyList.h @@ -40,7 +40,7 @@ private: ThemeMetric MOVE_COMMAND; AutoActor m_Cursors[NUM_PLAYERS]; - ActorFrame m_CursorFrames[NUM_PLAYERS]; + ActorFrame m_CursorFrames[NUM_PLAYERS]; // contains Cursor so that color can fade independent of other tweens struct Line { diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index b1c7b3cdf6..08ef0a61e5 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -48,11 +48,16 @@ void DifficultyMeter::Load( const RString &sType ) m_iNumTicks.Load(sType,"NumTicks"); m_iMaxTicks.Load(sType,"MaxTicks"); m_bShowTicks.Load(sType,"ShowTicks"); - m_bShowDifficulty.Load(sType,"ShowDifficulty"); m_bShowMeter.Load(sType,"ShowMeter"); m_bShowEditDescription.Load(sType,"ShowEditDescription"); m_sZeroMeterString.Load(sType,"ZeroMeterString"); + + m_sprFrame.Load( THEME->GetPathG(sType,"frame") ); + m_sprFrame->SetName( "Frame" ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_sprFrame, sType ); + this->AddChild( m_sprFrame ); + if( m_bShowTicks ) { m_textTicks.SetName( "Ticks" ); @@ -65,17 +70,6 @@ void DifficultyMeter::Load( const RString &sType ) this->AddChild( &m_textTicks ); } - if( m_bShowDifficulty ) - { - m_Difficulty.Load( THEME->GetPathG(sType,"difficulty") ); - m_Difficulty->SetName( "Difficulty" ); - ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_Difficulty, sType ); - this->AddChild( m_Difficulty ); - - // These commands should have been loaded by SetXYAndOnCommand above. - ASSERT( m_Difficulty->HasCommand("Set") ); - } - if( m_bShowMeter ) { m_textMeter.SetName( "Meter" ); @@ -136,7 +130,7 @@ void DifficultyMeter::SetFromSteps( const Steps* pSteps ) return; } - SetParams params = { pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty(), false, pSteps->GetDescription() }; + SetParams params = { pSteps, NULL, pSteps->GetMeter(), pSteps->m_StepsType, pSteps->GetDifficulty(), false, pSteps->GetDescription() }; SetInternal( params ); } @@ -148,37 +142,42 @@ void DifficultyMeter::SetFromTrail( const Trail* pTrail ) return; } - SetParams params = { pTrail->GetMeter(), pTrail->m_StepsType, pTrail->m_CourseDifficulty, true, RString() }; + SetParams params = { NULL, pTrail, pTrail->GetMeter(), pTrail->m_StepsType, pTrail->m_CourseDifficulty, true, RString() }; SetInternal( params ); } void DifficultyMeter::Unset() { - SetParams params = { 0, StepsType_Invalid, Difficulty_Invalid, false, RString() }; + SetParams params = { NULL, NULL, 0, StepsType_Invalid, Difficulty_Invalid, false, RString() }; SetInternal( params ); } void DifficultyMeter::SetFromStepsTypeAndMeterAndDifficulty( StepsType st, int iMeter, Difficulty dc ) { - SetParams params = { iMeter, st, dc, false, RString() }; + SetParams params = { NULL, NULL, iMeter, st, dc, false, RString() }; SetInternal( params ); } void DifficultyMeter::SetFromStepsTypeAndMeterAndCourseDifficulty( StepsType st, int iMeter, CourseDifficulty cd ) { - SetParams params = { 0, st, cd, true, RString() }; + SetParams params = { NULL, NULL, 0, st, cd, true, RString() }; SetInternal( params ); } void DifficultyMeter::SetInternal( const SetParams ¶ms ) { Message msg( "Set" ); + if( params.pSteps ) + msg.SetParam( "Steps", LuaReference::CreateFromPush(*(Steps*)params.pSteps) ); + if( params.pTrail ) + msg.SetParam( "Trail", LuaReference::CreateFromPush(*(Trail*)params.pTrail) ); 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 ); + m_sprFrame->HandleMessage( msg ); if( m_bShowTicks ) { @@ -223,8 +222,6 @@ void DifficultyMeter::SetInternal( const SetParams ¶ms ) m_textEditDescription.HandleMessage( msg ); } - if( m_bShowDifficulty ) - m_Difficulty->HandleMessage( msg ); if( m_bShowMeter ) m_textMeter.HandleMessage( msg ); } diff --git a/stepmania/src/DifficultyMeter.h b/stepmania/src/DifficultyMeter.h index 0e2ea6321c..8ee4bd9deb 100644 --- a/stepmania/src/DifficultyMeter.h +++ b/stepmania/src/DifficultyMeter.h @@ -38,35 +38,24 @@ public: private: struct SetParams { + const Steps *pSteps; + const Trail *pTrail; int iMeter; StepsType st; Difficulty dc; bool bIsCourseDifficulty; RString sEditDescription; - - bool operator==( const SetParams &other ) - { -#define COMPARE( x ) if( x != other.x ) return false; - COMPARE( iMeter ); - COMPARE( st ); - COMPARE( dc ); - COMPARE( bIsCourseDifficulty ); - COMPARE( sEditDescription ); -#undef COMPARE - return true; - } }; void SetInternal( const SetParams ¶ms ); + AutoActor m_sprFrame; BitmapText m_textTicks; /* XXXX000000 */ - AutoActor m_Difficulty; /* "easy", "hard" */ BitmapText m_textMeter; /* 3, 9 */ BitmapText m_textEditDescription; ThemeMetric m_iNumTicks; ThemeMetric m_iMaxTicks; ThemeMetric m_bShowTicks; - ThemeMetric m_bShowDifficulty; ThemeMetric m_bShowMeter; ThemeMetric m_bShowEditDescription; ThemeMetric m_sZeroMeterString;