#include "global.h" #include "OptionIcon.h" #include "ThemeManager.h" #include "PlayerOptions.h" #include "RageUtil.h" #define TEXT_OFFSET_X THEME->GetMetricF("OptionIcon","TextOffsetX") #define TEXT_OFFSET_Y THEME->GetMetricF("OptionIcon","TextOffsetY") #define TEXT_H_ALIGN THEME->GetMetricI("OptionIcon","TextHAlign") #define TEXT_V_ALIGN THEME->GetMetricI("OptionIcon","TextVAlign") #define TEXT_WIDTH THEME->GetMetricI("OptionIcon","TextWidth") #define TEXT_ZOOM THEME->GetMetricF("OptionIcon","TextZoom") #define UPPERCASE THEME->GetMetricB("OptionIcon","Uppercase") OptionIcon::OptionIcon() { } OptionIcon::OptionIcon( const OptionIcon &cpy ): ActorFrame(cpy), m_text(cpy.m_text), m_spr(cpy.m_spr) { this->RemoveAllChildren(); this->AddChild( &m_spr ); this->AddChild( &m_text ); } void OptionIcon::Load( RString sType ) { m_spr.Load( THEME->GetPathG(sType,"icon 3x2") ); m_spr.StopAnimating(); this->AddChild( &m_spr ); m_text.LoadFromFont( THEME->GetPathF(sType,"icon") ); m_text.SetShadowLength( 0 ); m_text.SetZoom( TEXT_ZOOM ); m_text.SetXY( TEXT_OFFSET_X, TEXT_OFFSET_Y ); m_text.SetHorizAlign( (HorizAlign)TEXT_H_ALIGN ); m_text.SetVertAlign( (VertAlign)TEXT_V_ALIGN ); this->AddChild( &m_text ); } void OptionIcon::Set( PlayerNumber pn, const RString &_sText, bool bHeader ) { RString sText = _sText; static const RString sStopWords[] = { "1X", "DEFAULT", "OVERHEAD", "OFF", }; for( unsigned i=0; i