If textures don't exist in the bfres, uncheck placeholder option as there isn't a way to tell if they can be used

This commit is contained in:
KillzXGaming 2019-05-14 20:41:03 -04:00
parent 85cd8dcafc
commit 8f35052887
7 changed files with 35 additions and 0 deletions

Binary file not shown.

View file

@ -761,6 +761,26 @@ namespace FirstPlugin
LoadEditors(this);
}
public bool HasTextures
{
get
{
foreach (TreeNode folder in Nodes)
{
if (folder is BFRESGroupNode)
{
return (((BFRESGroupNode)folder).Type == BRESGroupType.Textures &&
folder.Nodes.Count > 0);
}
if (folder is BNTX)
{
return ((BNTX)folder).Textures.Count > 0;
}
}
return false;
}
}
public void LoadFile(ResU.ResFile res)
{
CanDelete = true;

View file

@ -675,7 +675,16 @@ namespace Bfres.Structs
MessageBox.Show("No models found!");
return;
}
BfresModelImportSettings settings = new BfresModelImportSettings();
if (Parent != null)
{
bool HasTextures = ((BFRES)Parent.Parent).HasTextures;
settings.UpdateTexturePlaceholderSetting(HasTextures);
}
settings.SetModelAttributes(assimp.objects[0]);
if (settings.ShowDialog() == DialogResult.OK)
{

View file

@ -198,6 +198,12 @@ namespace FirstPlugin
}
public void UpdateTexturePlaceholderSetting(bool UsePlaceholder)
{
GeneratePlaceholderTextures = UsePlaceholder;
chkPlaceHolderTextures.Checked = GeneratePlaceholderTextures;
}
//Based on Wexos Toolbox since I'm not sure what formats to use for each attribute
//Thanks Wexos!
private void BfresModelImportSettings_Load(object sender, EventArgs e)