handle Lua AtExpressions in xml

This commit is contained in:
Chris Danford
2006-06-14 02:44:02 +00:00
parent 84b59f1510
commit dde50d0325
2 changed files with 13 additions and 4 deletions
+7 -2
View File
@@ -10,6 +10,7 @@
#include "Trail.h"
#include "ActorUtil.h"
#include "XmlFile.h"
#include "LuaManager.h"
REGISTER_ACTOR_CLASS(DifficultyIcon)
@@ -45,8 +46,12 @@ void DifficultyIcon::LoadFromNode( const RString& sDir, const XNode* pNode )
if( !pNode->GetAttrValue( "File", sFile ) )
RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" );
sFile = sDir + sFile;
ActorUtil::ResolvePath( sFile, sDir );
LuaHelpers::RunAtExpressionS( sFile );
if( !sFile.empty() && sFile[0] != '/' )
{
sFile = sDir + sFile;
ActorUtil::ResolvePath( sFile, sDir );
}
Load( sFile );
+6 -2
View File
@@ -43,8 +43,12 @@ void MeterDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
if( !pNode->GetAttrValue( "StreamPath", sStreamPath ) )
RageException::Throw( "MeterDisplay in " + sDir + " missing StreamPath attribute" );
sStreamPath = sDir + sStreamPath;
ActorUtil::ResolvePath( sStreamPath, sDir );
LuaHelpers::RunAtExpressionS( sStreamPath );
if( !sStreamPath.empty() && sStreamPath[0] != '/' )
{
sStreamPath = sDir + sStreamPath;
ActorUtil::ResolvePath( sStreamPath, sDir );
}
m_sprStream.Load( sStreamPath );
m_sprStream->SetZoomX( m_fStreamWidth / m_sprStream->GetUnzoomedWidth() );