mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-17 06:18:26 +00:00
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:
parent
85cd8dcafc
commit
8f35052887
7 changed files with 35 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue