Resolve directory names to embedded default.xml/default.lua files
at the pathname resolution stage (THEME:GetPath, ResolvePath), not at loading. This means that pathnames to Lua files are actually paths to Lua files, without any extra processing, and we always load actual files (except for BGAnimation compatibility), not directories. (fixes Lua LoadActor() on a directory loading as a BGA and not as Lua)
This commit is contained in:
+17
-20
@@ -103,6 +103,23 @@ retry:
|
||||
sPath = asPaths[0];
|
||||
}
|
||||
|
||||
if( ft == RageFileManager::TYPE_DIR )
|
||||
{
|
||||
RString sXMLPath = sPath + "/default.xml";
|
||||
if( DoesFileExist(sXMLPath) )
|
||||
{
|
||||
sPath = sXMLPath;
|
||||
return true;
|
||||
}
|
||||
|
||||
RString sLuaPath = sPath + "/default.lua";
|
||||
if( DoesFileExist(sLuaPath) )
|
||||
{
|
||||
sPath = sLuaPath;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
sPath = DerefRedir( sPath );
|
||||
return true;
|
||||
}
|
||||
@@ -356,26 +373,6 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const X
|
||||
if( ft == FT_Directory && sPath.Right(1) != "/" )
|
||||
sPath += '/';
|
||||
|
||||
if( ft == FT_Directory )
|
||||
{
|
||||
RString sXMLPath = sPath + "default.xml";
|
||||
if( DoesFileExist(sXMLPath) )
|
||||
{
|
||||
sPath = sXMLPath;
|
||||
ft = FT_Xml;
|
||||
}
|
||||
}
|
||||
|
||||
if( ft == FT_Directory )
|
||||
{
|
||||
RString sLuaPath = sPath + "default.lua";
|
||||
if( DoesFileExist(sLuaPath) )
|
||||
{
|
||||
sPath = sLuaPath;
|
||||
ft = FT_Lua;
|
||||
}
|
||||
}
|
||||
|
||||
switch( ft )
|
||||
{
|
||||
case FT_Xml:
|
||||
|
||||
Reference in New Issue
Block a user