Fix bfres not opening in archives.
This commit is contained in:
parent
71f9ea0276
commit
76a82effe7
Binary file not shown.
@ -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);
|
||||
|
@ -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);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user