1
0
mirror of synced 2025-01-31 12:23:52 +01:00

List out texture placeholders for bfres when missing textures on save.

This commit is contained in:
KillzXGaming 2020-05-26 14:59:49 -04:00
parent 1e78c7950f
commit d3839e87b7
2 changed files with 15 additions and 4 deletions

View File

@ -1921,13 +1921,21 @@ namespace FirstPlugin
if (bntx.Textures.Count == 0)
return;
List<string> textureList = new List<string>();
foreach (MatTexture tex in shape.GetMaterial().TextureMaps)
{
if (!bntx.Textures.ContainsKey(tex.Name))
if (!bntx.Textures.ContainsKey(tex.Name) && !textureList.Contains(tex.Name))
textureList.Add(tex.Name);
}
foreach (var tex in textureList)
{
if (!bntx.Textures.ContainsKey(tex))
{
if (!ImportMissingTextures)
{
DialogResult result = MessageBox.Show("Missing textures found! Would you like to use placeholders?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
string textureDetails = string.Join("\n",textureList);
DialogResult result = MessageBox.Show($"Missing textures found! Would you like to use placeholders?\nTextures:\n{textureDetails}", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
@ -1938,7 +1946,10 @@ namespace FirstPlugin
}
if (ImportMissingTextures)
bntx.ImportPlaceholderTexture(tex.Name);
{
foreach (var texture in textureList)
bntx.ImportPlaceholderTexture(texture);
}
}
}
}

View File

@ -33,7 +33,7 @@ namespace Toolbox.Library
return false;
}
public bool CanCompress { get; } = true;
public bool CanCompress { get; } = false;
private bool UseLZMAMagicHeader = true;