From 4ae2e8b58bab26d0503e8c1089cd05aff77650c2 Mon Sep 17 00:00:00 2001 From: aianlinb Date: Fri, 2 Oct 2020 17:04:18 +0800 Subject: [PATCH] Fix missed bundle size This doesn't seem to affect the game. --- LibBundle/IndexContainer.cs | 2 +- LibBundle/Properties/AssemblyInfo.cs | 4 ++-- LibBundle/Records/BundleRecord.cs | 5 +++-- VisualBundle/MainWindow.xaml | 16 ++++++++-------- VisualBundle/MainWindow.xaml.cs | 4 ++-- VisualBundle/Properties/AssemblyInfo.cs | 4 ++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/LibBundle/IndexContainer.cs b/LibBundle/IndexContainer.cs index f09f43b..b9197e5 100644 --- a/LibBundle/IndexContainer.cs +++ b/LibBundle/IndexContainer.cs @@ -111,7 +111,7 @@ public override void Save(string path) { bw.Write(b.nameLength); bw.Write(Encoding.UTF8.GetBytes(b.Name), 0, b.nameLength); - bw.Write(b.Size); + bw.Write(b.UncompressedSize); } bw.Write(Files.Length); foreach (var f in Files) diff --git a/LibBundle/Properties/AssemblyInfo.cs b/LibBundle/Properties/AssemblyInfo.cs index 4f3cd94..3903172 100644 --- a/LibBundle/Properties/AssemblyInfo.cs +++ b/LibBundle/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號 // 設為預設,如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] diff --git a/LibBundle/Records/BundleRecord.cs b/LibBundle/Records/BundleRecord.cs index be3590c..1528a56 100644 --- a/LibBundle/Records/BundleRecord.cs +++ b/LibBundle/Records/BundleRecord.cs @@ -9,7 +9,7 @@ public class BundleRecord public int bundleIndex; public int nameLength; public string Name; - public int Size; + public int UncompressedSize; public List Files; internal Dictionary dataToAdd = new Dictionary(); private BundleContainer _bundle; @@ -29,7 +29,7 @@ public BundleRecord(BinaryReader br) indexOffset = br.BaseStream.Position; nameLength = br.ReadInt32(); Name = System.Text.Encoding.UTF8.GetString(br.ReadBytes(nameLength)) + ".bundle.bin"; - Size = br.ReadInt32(); + UncompressedSize = br.ReadInt32(); Files = new List(); } @@ -59,6 +59,7 @@ public void Save(string path) } } Bundle.dataToSave = dataToSave.ToArray(); + UncompressedSize = Bundle.dataToSave.Length; Bundle.Save(path); dataToAdd = new Dictionary(); data.Close(); diff --git a/VisualBundle/MainWindow.xaml b/VisualBundle/MainWindow.xaml index 8bdea59..462e182 100644 --- a/VisualBundle/MainWindow.xaml +++ b/VisualBundle/MainWindow.xaml @@ -1,7 +1,7 @@  + Title="VisualBundle v1.2.1" Height="480" Width="800" Loaded="OnLoaded" Closing="OnWindowClosing"> @@ -13,14 +13,14 @@ - - - - - + + + + + - - + + diff --git a/VisualBundle/MainWindow.xaml.cs b/VisualBundle/MainWindow.xaml.cs index ffe099b..404b7f0 100644 --- a/VisualBundle/MainWindow.xaml.cs +++ b/VisualBundle/MainWindow.xaml.cs @@ -155,7 +155,7 @@ private void OnTreeView1SelectedChanged(object sender, RoutedPropertyChangedEven if (moveF != null) MoveF(br); offsetView.Text = br.indexOffset.ToString(); - sizeView.Text = br.Size.ToString(); + sizeView.Text = br.UncompressedSize.ToString(); noView.Text = br.bundleIndex.ToString(); var root = new FolderModel("Bundles2"); foreach (var f in br.Files) @@ -554,7 +554,7 @@ private void ButtonReplaceAllClick(object sender, RoutedEventArgs e) if (fbd.ShowDialog() == true) { if (MessageBox.Show( - "This will replace all files to every loaded bundles." + Environment.NewLine + "This will replace all files to every loaded bundles (doesn't contain which were filtered)." + Environment.NewLine + "And bundles which weren't loaded won't be changed." + Environment.NewLine + "Are you sure you want to do this?", "Replace All Confirm", diff --git a/VisualBundle/Properties/AssemblyInfo.cs b/VisualBundle/Properties/AssemblyInfo.cs index 2ee39bd..0fc841e 100644 --- a/VisualBundle/Properties/AssemblyInfo.cs +++ b/VisualBundle/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號 // 設為預設,如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")]