diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index 2474cb9581..f0277ce1e3 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -9,6 +9,10 @@ #include "RageDisplay.h" #include "arch/Dialog/Dialog.h" #include "Trail.h" +#include "ActorUtil.h" +#include "XmlFile.h" + +REGISTER_ACTOR_CLASS(DifficultyIcon) DifficultyIcon::DifficultyIcon() { @@ -36,6 +40,21 @@ bool DifficultyIcon::Load( CString sPath ) return true; } +void DifficultyIcon::LoadFromNode( const CString& sDir, const XNode* pNode ) +{ + CString sFile; + if( !pNode->GetAttrValue( "File", sFile ) ) + RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" ); + + sFile = sDir + sFile; + ActorUtil::ResolvePath( sFile, sDir ); + + Load( sFile ); + + // skip Sprite::LoadFromNode + Actor::LoadFromNode( sDir, pNode ); +} + void DifficultyIcon::SetFromSteps( PlayerNumber pn, const Steps* pSteps ) { if( pSteps == NULL ) diff --git a/stepmania/src/DifficultyIcon.h b/stepmania/src/DifficultyIcon.h index a1a4636660..f9a59e0009 100644 --- a/stepmania/src/DifficultyIcon.h +++ b/stepmania/src/DifficultyIcon.h @@ -18,6 +18,7 @@ public: virtual bool EarlyAbortDraw() { return m_bBlank || Sprite::EarlyAbortDraw(); } bool Load( CString sFilePath ); + virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); void SetFromSteps( PlayerNumber pn, const Steps* pSteps ); void SetFromTrail( PlayerNumber pn, const Trail* pTrail );