1
0
mirror of synced 2024-11-12 02:00:50 +01: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;
using Switch_Toolbox.Library.IO; using Switch_Toolbox.Library.IO;
using Switch_Toolbox.Library.Forms; using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library.NodeWrappers;
namespace FirstPlugin namespace FirstPlugin
{ {
@ -321,7 +322,7 @@ namespace FirstPlugin
{ {
IFileFormat file = STFileLoader.OpenFileFormat(FullName, Data,false, true, this); 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); sarc.OpenedFiles.Add(FullPath, Data);
ReplaceNode(this.Parent, this, (TreeNode)file); 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", MessageBox.Show("A single material must exist if any objects exist!", "Material Delete",
MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
foreach (var shape in model.shapes) foreach (var shape in model.shapes)
{ {
if (shape.GetMaterial() == this) if (shape.GetMaterial() == this)
{
MappedNames += $"{shape.Text}\n"; MappedNames += $"{shape.Text}\n";
}
} }
if (MappedNames != "") 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)", 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); "Material Delete", MappedNames);
if (result == DialogResult.Yes) { if (result == DialogResult.Yes)
RemoveMaterial(model, CurrentIndex); RemoveMaterial(model, CurrentIndex);
}
} }
else { else {
RemoveMaterial(model, CurrentIndex); RemoveMaterial(model, CurrentIndex);