diff --git a/File_Format_Library/FileFormats/Archives/ARC.cs b/File_Format_Library/FileFormats/Archives/ARC.cs index 0590099e..1e008243 100644 --- a/File_Format_Library/FileFormats/Archives/ARC.cs +++ b/File_Format_Library/FileFormats/Archives/ARC.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/BEA.cs b/File_Format_Library/FileFormats/Archives/BEA.cs index 43f18b11..e94160be 100644 --- a/File_Format_Library/FileFormats/Archives/BEA.cs +++ b/File_Format_Library/FileFormats/Archives/BEA.cs @@ -23,7 +23,11 @@ namespace FirstPlugin public bool CanReplaceFiles { get; set; } = true; public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool CanSave { get; set; } public string[] Description { get; set; } = new string[] { "Bevel Engine Archive" }; diff --git a/File_Format_Library/FileFormats/Archives/GFA.cs b/File_Format_Library/FileFormats/Archives/GFA.cs index 714abda3..0e05abdf 100644 --- a/File_Format_Library/FileFormats/Archives/GFA.cs +++ b/File_Format_Library/FileFormats/Archives/GFA.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } private uint Unknown1; private uint Version; diff --git a/File_Format_Library/FileFormats/Archives/GFPAK.cs b/File_Format_Library/FileFormats/Archives/GFPAK.cs index 9597d5be..9456ca54 100644 --- a/File_Format_Library/FileFormats/Archives/GFPAK.cs +++ b/File_Format_Library/FileFormats/Archives/GFPAK.cs @@ -93,7 +93,11 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool CanAddFiles { get; set; } = false; public bool CanRenameFiles { get; set; } = false; diff --git a/File_Format_Library/FileFormats/Archives/IGA_PAK.cs b/File_Format_Library/FileFormats/Archives/IGA_PAK.cs index e1218437..9cd47b99 100644 --- a/File_Format_Library/FileFormats/Archives/IGA_PAK.cs +++ b/File_Format_Library/FileFormats/Archives/IGA_PAK.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/LZARC.cs b/File_Format_Library/FileFormats/Archives/LZARC.cs index eefd68ea..6976df84 100644 --- a/File_Format_Library/FileFormats/Archives/LZARC.cs +++ b/File_Format_Library/FileFormats/Archives/LZARC.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/ME01.cs b/File_Format_Library/FileFormats/Archives/ME01.cs index 3f741bed..a95342db 100644 --- a/File_Format_Library/FileFormats/Archives/ME01.cs +++ b/File_Format_Library/FileFormats/Archives/ME01.cs @@ -48,7 +48,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } private uint Alignment; public void Load(System.IO.Stream stream) diff --git a/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs b/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs index 6af65b74..a6de5b99 100644 --- a/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs +++ b/File_Format_Library/FileFormats/Archives/MKGPDX_PAC.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/NXARC.cs b/File_Format_Library/FileFormats/Archives/NXARC.cs index 1b3e3726..c16ae0cd 100644 --- a/File_Format_Library/FileFormats/Archives/NXARC.cs +++ b/File_Format_Library/FileFormats/Archives/NXARC.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public void Load(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Archives/RARC.cs b/File_Format_Library/FileFormats/Archives/RARC.cs index 865e17d2..bb55b6be 100644 --- a/File_Format_Library/FileFormats/Archives/RARC.cs +++ b/File_Format_Library/FileFormats/Archives/RARC.cs @@ -46,7 +46,12 @@ namespace FirstPlugin public List files = new List(); public List nodes = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } + public IEnumerable Nodes => nodes; public string Name diff --git a/File_Format_Library/FileFormats/Archives/SARC.cs b/File_Format_Library/FileFormats/Archives/SARC.cs index e0af6a2b..ed69bab0 100644 --- a/File_Format_Library/FileFormats/Archives/SARC.cs +++ b/File_Format_Library/FileFormats/Archives/SARC.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } = true; public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public SarcData sarcData; public string SarcHash; diff --git a/File_Format_Library/FileFormats/Archives/SDF.cs b/File_Format_Library/FileFormats/Archives/SDF.cs index 1696d62b..7f831ddb 100644 --- a/File_Format_Library/FileFormats/Archives/SDF.cs +++ b/File_Format_Library/FileFormats/Archives/SDF.cs @@ -45,7 +45,10 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files { + get { return files; } + set { } + } SDFTOC_Header Header; public SDFTOC_Block2[] block2Array; diff --git a/File_Format_Library/FileFormats/Archives/SP2.cs b/File_Format_Library/FileFormats/Archives/SP2.cs index 7269f2c7..0ad2b860 100644 --- a/File_Format_Library/FileFormats/Archives/SP2.cs +++ b/File_Format_Library/FileFormats/Archives/SP2.cs @@ -39,7 +39,11 @@ namespace FirstPlugin } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool CanAddFiles { get; set; } public bool CanRenameFiles { get; set; } diff --git a/File_Format_Library/FileFormats/Archives/TMPK.cs b/File_Format_Library/FileFormats/Archives/TMPK.cs index e7042799..efa0c63e 100644 --- a/File_Format_Library/FileFormats/Archives/TMPK.cs +++ b/File_Format_Library/FileFormats/Archives/TMPK.cs @@ -46,8 +46,11 @@ namespace FirstPlugin } public List files = new List(); - - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool CanAddFiles { get; set; } = true; public bool CanRenameFiles { get; set; } = true; diff --git a/File_Format_Library/FileFormats/Archives/U8.cs b/File_Format_Library/FileFormats/Archives/U8.cs index a0d78519..4367a4b5 100644 --- a/File_Format_Library/FileFormats/Archives/U8.cs +++ b/File_Format_Library/FileFormats/Archives/U8.cs @@ -46,7 +46,12 @@ namespace FirstPlugin public List nodes = new List(); - public IEnumerable Files => null; + public IEnumerable Files + { + get { return null; } + set { } + } + public IEnumerable Nodes => nodes; public string Name diff --git a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs index 63d1a123..94cd6afe 100644 --- a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs +++ b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSHP.cs @@ -1041,15 +1041,17 @@ namespace Bfres.Structs { int j = 0; - SortedDictionary envelopes = new SortedDictionary(); + List> envelopes = new List>(); for (j = 0; j < v.boneIds.Count; j++) - envelopes.Add(v.boneIds[j], v.boneWeights[j]); + envelopes.Add(Tuple.Create(v.boneIds[j], v.boneWeights[j])); + + envelopes.Sort((x, y) => y.Item1.CompareTo(x.Item1)); j = 0; - foreach (var envelope in envelopes) + foreach (var envelope in envelopes.OrderBy(x => x.Item1)) { - v.boneIds[j] = envelope.Key; - v.boneWeights[j] = envelope.Value; + v.boneIds[j] = envelope.Item1; + v.boneWeights[j] = envelope.Item2; j++; } diff --git a/File_Format_Library/FileFormats/Rom/GCDisk.cs b/File_Format_Library/FileFormats/Rom/GCDisk.cs index 3e9e5b9f..9be8e610 100644 --- a/File_Format_Library/FileFormats/Rom/GCDisk.cs +++ b/File_Format_Library/FileFormats/Rom/GCDisk.cs @@ -36,7 +36,11 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/IStorage.cs b/File_Format_Library/FileFormats/Rom/IStorage.cs index 50c692b8..0e6f07a9 100644 --- a/File_Format_Library/FileFormats/Rom/IStorage.cs +++ b/File_Format_Library/FileFormats/Rom/IStorage.cs @@ -35,7 +35,11 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/NCA.cs b/File_Format_Library/FileFormats/Rom/NCA.cs index 13212518..177c1120 100644 --- a/File_Format_Library/FileFormats/Rom/NCA.cs +++ b/File_Format_Library/FileFormats/Rom/NCA.cs @@ -35,7 +35,10 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files { + get { return Files; } + set { } + } public bool Identify(System.IO.Stream stream) { diff --git a/File_Format_Library/FileFormats/Rom/NSP.cs b/File_Format_Library/FileFormats/Rom/NSP.cs index 7d7815c6..61a80ce1 100644 --- a/File_Format_Library/FileFormats/Rom/NSP.cs +++ b/File_Format_Library/FileFormats/Rom/NSP.cs @@ -45,7 +45,11 @@ namespace FirstPlugin public bool CanDeleteFiles { get; set; } public List files = new List(); - public IEnumerable Files => files; + public IEnumerable Files + { + get { return files; } + set { } + } public bool Identify(System.IO.Stream stream) { diff --git a/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs b/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs index b66f66e6..0fdb3ad3 100644 --- a/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs +++ b/Switch_Toolbox_Library/Interfaces/IArchiveFile.cs @@ -27,7 +27,7 @@ namespace Toolbox.Library bool CanReplaceFiles { get; } bool CanDeleteFiles { get; } - IEnumerable Files { get; } + IEnumerable Files { get; set; } bool AddFile(ArchiveFileInfo archiveFileInfo); bool DeleteFile(ArchiveFileInfo archiveFileInfo); @@ -296,6 +296,8 @@ namespace Toolbox.Library progressBar.Task = "Repacking Files..."; progressBar.Refresh(); + (ArchiveFile.Files as List)?.Clear(); + for (int i = 0; i < ProccessedFiles.Count; i++) { progressBar.Value = (i * 100) / ProccessedFiles.Count;