handle Lua AtExpressions in xml
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include "Trail.h"
|
#include "Trail.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
|
#include "LuaManager.h"
|
||||||
|
|
||||||
REGISTER_ACTOR_CLASS(DifficultyIcon)
|
REGISTER_ACTOR_CLASS(DifficultyIcon)
|
||||||
|
|
||||||
@@ -45,8 +46,12 @@ void DifficultyIcon::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
if( !pNode->GetAttrValue( "File", sFile ) )
|
if( !pNode->GetAttrValue( "File", sFile ) )
|
||||||
RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" );
|
RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" );
|
||||||
|
|
||||||
|
LuaHelpers::RunAtExpressionS( sFile );
|
||||||
|
if( !sFile.empty() && sFile[0] != '/' )
|
||||||
|
{
|
||||||
sFile = sDir + sFile;
|
sFile = sDir + sFile;
|
||||||
ActorUtil::ResolvePath( sFile, sDir );
|
ActorUtil::ResolvePath( sFile, sDir );
|
||||||
|
}
|
||||||
|
|
||||||
Load( sFile );
|
Load( sFile );
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,12 @@ void MeterDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
if( !pNode->GetAttrValue( "StreamPath", sStreamPath ) )
|
if( !pNode->GetAttrValue( "StreamPath", sStreamPath ) )
|
||||||
RageException::Throw( "MeterDisplay in " + sDir + " missing StreamPath attribute" );
|
RageException::Throw( "MeterDisplay in " + sDir + " missing StreamPath attribute" );
|
||||||
|
|
||||||
|
LuaHelpers::RunAtExpressionS( sStreamPath );
|
||||||
|
if( !sStreamPath.empty() && sStreamPath[0] != '/' )
|
||||||
|
{
|
||||||
sStreamPath = sDir + sStreamPath;
|
sStreamPath = sDir + sStreamPath;
|
||||||
ActorUtil::ResolvePath( sStreamPath, sDir );
|
ActorUtil::ResolvePath( sStreamPath, sDir );
|
||||||
|
}
|
||||||
|
|
||||||
m_sprStream.Load( sStreamPath );
|
m_sprStream.Load( sStreamPath );
|
||||||
m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() );
|
m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() );
|
||||||
|
|||||||
Reference in New Issue
Block a user