From dde50d0325fcb4ce0e1319c8d25930166a177df2 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 14 Jun 2006 02:44:02 +0000 Subject: [PATCH] handle Lua AtExpressions in xml --- stepmania/src/DifficultyIcon.cpp | 9 +++++++-- stepmania/src/MeterDisplay.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index 6c74bda6ad..18d7de94f6 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -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 ); diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index dae41f66c2..447fe2d635 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -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() );