mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Let meta incorporation look at both extensions.
This commit is contained in:
parent
55c17c7845
commit
c681f1533d
1 changed files with 28 additions and 30 deletions
|
|
@ -154,43 +154,41 @@ public partial class Mod
|
|||
{
|
||||
foreach( var (key, file) in Files.ToList() )
|
||||
{
|
||||
var ext1 = key.Extension().AsciiToLower().ToString();
|
||||
var ext2 = file.Extension.ToLowerInvariant();
|
||||
try
|
||||
{
|
||||
switch( file.Extension )
|
||||
if( ext1 == ".meta" || ext2 == ".meta" )
|
||||
{
|
||||
case ".meta":
|
||||
FileData.Remove( key );
|
||||
if( !file.Exists )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
FileData.Remove( key );
|
||||
if( !file.Exists )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var meta = new TexToolsMeta( File.ReadAllBytes( file.FullName ) );
|
||||
if( delete )
|
||||
{
|
||||
File.Delete( file.FullName );
|
||||
}
|
||||
var meta = new TexToolsMeta( File.ReadAllBytes( file.FullName ) );
|
||||
if( delete )
|
||||
{
|
||||
File.Delete( file.FullName );
|
||||
}
|
||||
|
||||
ManipulationData.UnionWith( meta.MetaManipulations );
|
||||
ManipulationData.UnionWith( meta.MetaManipulations );
|
||||
}
|
||||
else if( ext1 == ".rgsp" || ext2 == ".rgsp" )
|
||||
{
|
||||
FileData.Remove( key );
|
||||
if( !file.Exists )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
case ".rgsp":
|
||||
FileData.Remove( key );
|
||||
if( !file.Exists )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rgsp = TexToolsMeta.FromRgspFile( file.FullName, File.ReadAllBytes( file.FullName ) );
|
||||
if( delete )
|
||||
{
|
||||
File.Delete( file.FullName );
|
||||
}
|
||||
|
||||
var rgsp = TexToolsMeta.FromRgspFile( file.FullName, File.ReadAllBytes( file.FullName ) );
|
||||
if( delete )
|
||||
{
|
||||
File.Delete( file.FullName );
|
||||
}
|
||||
|
||||
ManipulationData.UnionWith( rgsp.MetaManipulations );
|
||||
|
||||
break;
|
||||
default: continue;
|
||||
ManipulationData.UnionWith( rgsp.MetaManipulations );
|
||||
}
|
||||
}
|
||||
catch( Exception e )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue