1
0
mirror of synced 2024-09-24 11:38:22 +02:00

Fix bfres not opening in archives.

This commit is contained in:
KillzXGaming 2019-03-29 16:37:20 -04:00
parent 71f9ea0276
commit 76a82effe7
6 changed files with 3 additions and 6 deletions

Binary file not shown.

View File

@ -8,6 +8,7 @@ using SARCExt;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.IO;
using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library.NodeWrappers;
namespace FirstPlugin
{
@ -321,7 +322,7 @@ namespace FirstPlugin
{
IFileFormat file = STFileLoader.OpenFileFormat(FullName, Data,false, true, this);
if (file != null && file is TreeNodeFile)
if (file != null && file is TreeNodeFile || file is STGenericWrapper)
{
sarc.OpenedFiles.Add(FullPath, Data);
ReplaceNode(this.Parent, this, (TreeNode)file);

View File

@ -123,25 +123,21 @@ namespace Bfres.Structs
{
MessageBox.Show("A single material must exist if any objects exist!", "Material Delete",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
foreach (var shape in model.shapes)
{
if (shape.GetMaterial() == this)
{
MappedNames += $"{shape.Text}\n";
}
}
if (MappedNames != "")
{
var result = STOptionsDialog.Show("Shapes are mapped to this material. Are you sure you want to remove this? (Will default to first material)",
"Material Delete", MappedNames);
if (result == DialogResult.Yes) {
if (result == DialogResult.Yes)
RemoveMaterial(model, CurrentIndex);
}
}
else {
RemoveMaterial(model, CurrentIndex);