Fix BARS that have null audio entries for certain slots
This commit is contained in:
parent
aede3839dc
commit
7a396e2095
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,7 +9,7 @@ using Switch_Toolbox.Library;
|
|||||||
using Switch_Toolbox.Library.IO;
|
using Switch_Toolbox.Library.IO;
|
||||||
using Switch_Toolbox.Library.Forms;
|
using Switch_Toolbox.Library.Forms;
|
||||||
|
|
||||||
namespace FirstPlugin.New
|
namespace FirstPlugin
|
||||||
{
|
{
|
||||||
public class SARC : IArchiveFile, IFileFormat
|
public class SARC : IArchiveFile, IFileFormat
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ using Switch_Toolbox.Library;
|
|||||||
using Switch_Toolbox.Library.IO;
|
using Switch_Toolbox.Library.IO;
|
||||||
using Switch_Toolbox.Library.Forms;
|
using Switch_Toolbox.Library.Forms;
|
||||||
|
|
||||||
namespace FirstPlugin
|
namespace FirstPlugin.Old
|
||||||
{
|
{
|
||||||
public class SARC : TreeNodeFile, IFileFormat
|
public class SARC : TreeNodeFile, IFileFormat
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
public BarsProperty(BarsLib.BARS bars)
|
public BarsProperty(BarsLib.BARS bars)
|
||||||
{
|
{
|
||||||
AudioCount = bars.AmtaList.Count;
|
AudioCount = bars.AudioEntries.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,23 +226,23 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
bars = new BarsLib.BARS(stream);
|
bars = new BarsLib.BARS(stream);
|
||||||
|
|
||||||
if (bars.AmtaList.Count > 0)
|
if (bars.HasMetaData)
|
||||||
Nodes.Add("Meta Data");
|
Nodes.Add("Meta Data");
|
||||||
|
|
||||||
if (bars.audioList.Count > 0)
|
if (bars.HasAudioFiles)
|
||||||
Nodes.Add("Audio");
|
Nodes.Add("Audio");
|
||||||
|
|
||||||
for (int i = 0; i < bars.AmtaList.Count; i++)
|
for (int i = 0; i < bars.AudioEntries.Count; i++)
|
||||||
{
|
{
|
||||||
var amtaWrapper = new MetaDataNodeWrapper(bars.AmtaList[i]);
|
var amtaWrapper = new MetaDataNodeWrapper(bars.AudioEntries[i].MetaData);
|
||||||
string audioName = bars.AmtaList[i].Name;
|
string audioName = bars.AudioEntries[i].MetaData.Name;
|
||||||
|
|
||||||
amtaWrapper.Text = $"{audioName}.amta";
|
amtaWrapper.Text = $"{audioName}.amta";
|
||||||
Nodes[0].Nodes.Add(amtaWrapper);
|
Nodes[0].Nodes.Add(amtaWrapper);
|
||||||
|
|
||||||
if (bars.audioList.Count > 0)
|
if (bars.AudioEntries[i].AudioFile != null)
|
||||||
{
|
{
|
||||||
BARSAudioFile audio = bars.audioList[i];
|
BARSAudioFile audio = bars.AudioEntries[i].AudioFile;
|
||||||
|
|
||||||
AudioEntry node = new AudioEntry();
|
AudioEntry node = new AudioEntry();
|
||||||
node.Type = audio.AudioType;
|
node.Type = audio.AudioType;
|
||||||
@ -288,14 +288,14 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
foreach (TreeNode node in Nodes[1].Nodes)
|
foreach (TreeNode node in Nodes[1].Nodes)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < bars.AmtaList.Count; i++)
|
for (int i = 0; i < bars.AudioEntries.Count; i++)
|
||||||
{
|
{
|
||||||
string audioName = bars.AmtaList[i].Name;
|
string audioName = bars.AudioEntries[i].MetaData.Name;
|
||||||
|
|
||||||
if (Path.GetFileNameWithoutExtension(node.Text) == audioName)
|
if (Path.GetFileNameWithoutExtension(node.Text) == audioName)
|
||||||
{
|
{
|
||||||
Console.WriteLine(audioName);
|
Console.WriteLine(audioName);
|
||||||
bars.audioList[i].data = ((AudioEntry)node).Data;
|
bars.AudioEntries[i].AudioFile.data = ((AudioEntry)node).Data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user