diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index cf6575e989..2cc52269ee 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -21,6 +21,8 @@ sm-ssc v1.2.3 | 2011022? require them. [Wolfman2000] * [ArrowEffects] Allow for dizzy hold heads. Again, enable at your own risk. [Wolfman2000] +* [StepsDisplay] Allow for displaying the chart artist in a separate field. + This defaults to false for the moment. [Wolfman2000] 20110227 -------- diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 68ba286ca6..5443df7bfa 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1260,6 +1260,13 @@ DescriptionOnCommand= DescriptionOffCommand= DescriptionSetCommand= # +ShowCredit=false +CreditX=0 +CreditY=0 +CreditOnCommand= +CreditOffCommand= +CreditSetCommand= +# ShowAutogen=false AutogenSetCommand= # @@ -2048,6 +2055,11 @@ DescriptionX=-10 DescriptionY=0 DescriptionOnCommand=shadowlength,0;uppercase,true; DescriptionSetCommand=%function(self,param) if param.CustomDifficulty then self:diffuse(CustomDifficultyToLightColor(param.CustomDifficulty)); self:strokecolor(CustomDifficultyToDarkColor(param.CustomDifficulty)); end end +ShowCredit=false +CreditX=0 +CreditY=0 +CreditOnCommand= +CreditSetCommand= ShowAutogen=true AutogenX=40 AutogenY=0 diff --git a/src/StepsDisplay.cpp b/src/StepsDisplay.cpp index 16e4d300ff..46c048c462 100644 --- a/src/StepsDisplay.cpp +++ b/src/StepsDisplay.cpp @@ -55,6 +55,7 @@ void StepsDisplay::Load( const RString &sMetricsGroup, const PlayerState *pPlaye m_bShowTicks.Load(m_sMetricsGroup,"ShowTicks"); m_bShowMeter.Load(m_sMetricsGroup,"ShowMeter"); m_bShowDescription.Load(m_sMetricsGroup,"ShowDescription"); + m_bShowCredit.Load(m_sMetricsGroup,"ShowCredit"); m_bShowAutogen.Load(m_sMetricsGroup,"ShowAutogen"); m_bShowStepsType.Load(m_sMetricsGroup,"ShowStepsType"); m_sZeroMeterString.Load(m_sMetricsGroup,"ZeroMeterString"); @@ -91,6 +92,13 @@ void StepsDisplay::Load( const RString &sMetricsGroup, const PlayerState *pPlaye ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textDescription, m_sMetricsGroup ); this->AddChild( &m_textDescription ); } + if( m_bShowCredit ) + { + m_textAuthor.SetName( "Step Author" ); + m_textAuthor.LoadFromFont( THEME->GetPathF(m_sMetricsGroup,"Credit") ); + ActorUtil::LoadAllCommandsAndSetXYAndOnCommand( m_textAuthor, m_sMetricsGroup ); + this->AddChild( &m_textAuthor ); + } if( m_bShowAutogen ) { @@ -196,6 +204,10 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) else sDisplayDescription = CustomDifficultyToLocalizedString( sCustomDifficulty ); msg.SetParam( "DisplayDescription", sDisplayDescription ); + + RString sDisplayCredit; + if( params.pSteps ) + sDisplayCredit = params.pSteps->GetCredit(); if( params.pSteps ) msg.SetParam( "Steps", LuaReference::CreateFromPush(*(Steps*)params.pSteps) ); @@ -241,6 +253,11 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) m_textDescription.SetText( sDisplayDescription ); m_textDescription.HandleMessage( msg ); } + if( m_bShowCredit ) + { + m_textAuthor.SetText( sDisplayCredit ); + m_textAuthor.HandleMessage( msg ); + } if( m_bShowAutogen ) { diff --git a/src/StepsDisplay.h b/src/StepsDisplay.h index 0bab0fa4aa..3d6b7e9d60 100644 --- a/src/StepsDisplay.h +++ b/src/StepsDisplay.h @@ -1,5 +1,3 @@ -/* StepsDisplay - A graphical representation of a Steps or a Trail - has a difficulty number, meter, text, edit description. */ - #ifndef StepsDisplay_H #define StepsDisplay_H @@ -16,7 +14,10 @@ class Steps; class Trail; class PlayerState; - +/** + * @brief A graphical representation of a Steps or a Trail. + * + * It has a difficulty number, meter, text, and an edit description. */ class StepsDisplay : public ActorFrame { public: @@ -52,7 +53,13 @@ private: AutoActor m_sprFrame; BitmapText m_textTicks; // 111100000 BitmapText m_textMeter; // 3, 9 - BitmapText m_textDescription; // Easy, Medium, SuperCoolEdit + /** + * @brief The description of the chart. + * + * This is meant to be separate from the author of the chart. */ + BitmapText m_textDescription; + /** @brief The author of the chart. */ + BitmapText m_textAuthor; AutoActor m_sprAutogen; // visible if Steps and is autogen'd AutoActor m_sprStepsType; @@ -61,6 +68,7 @@ private: ThemeMetric m_bShowTicks; ThemeMetric m_bShowMeter; ThemeMetric m_bShowDescription; + ThemeMetric m_bShowCredit; ThemeMetric m_bShowAutogen; ThemeMetric m_bShowStepsType; ThemeMetric m_sZeroMeterString;