Fix(); Textures with pack:/ prefix not exporting

This commit is contained in:
ook3D 2023-08-15 01:43:00 -04:00
parent dcc5cd5837
commit 999adedb5d

View File

@ -1980,7 +1980,18 @@ namespace CodeWalker.Forms
{
try
{
string fpath = folderpath + tex.Name + ".dds";
string textureName = tex.Name;
if (textureName.StartsWith("pack:/", StringComparison.OrdinalIgnoreCase))
{
textureName = textureName.Substring(6);
}
if (textureName.EndsWith(".dds", StringComparison.OrdinalIgnoreCase))
{
textureName = textureName.Substring(0, textureName.Length - 4);
}
string fpath = folderpath + textureName + ".dds";
byte[] dds = DDSIO.GetDDSFile(tex);
File.WriteAllBytes(fpath, dds);
successcount++;