diff --git a/AssetStudio/BundleFile.cs b/AssetStudio/BundleFile.cs index eb352eb..8adf0c1 100644 --- a/AssetStudio/BundleFile.cs +++ b/AssetStudio/BundleFile.cs @@ -118,9 +118,9 @@ namespace AssetStudio { if (!unityVer.IsStripped && customUnityVer != unityVer) { - Logger.Warning($"Detected Unity version is different from the specified one ({customUnityVer.FullVersion.Color(ColorConsole.BrightCyan)}).\n" + - $"Assets may load with errors.\n" + - $"It is recommended to specify the detected Unity version: {unityVer.FullVersion.Color(ColorConsole.BrightCyan)}"); + Logger.Warning($"Detected Unity version [{unityVer.FullVersion.Color(ColorConsole.BrightCyan)}] is different from the specified one [{customUnityVer.FullVersion.Color(ColorConsole.BrightCyan)}].\n" + + "Assets may load with errors.\n" + + "It is recommended not to specify a Unity version for this file."); } unityVer = customUnityVer; } @@ -359,12 +359,13 @@ namespace AssetStudio case CompressionType.Lzham: throw new IOException($"Unsupported blockInfo compression type: {compressionType}.\n"); default: - throw new IOException($"Unknown blockInfo compression type: {compressionType}.\nYou may try to specify the compression type manually.\n"); + throw new IOException($"Unknown blockInfo compression type: {compressionType}.\nYou may try to specify the compression type manually in the options.\n"); } if (numWrite != uncompressedSize) { - var msg = $"{compressionType} blockInfo decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {uncompressedSize} bytes."; + var type = compressionType == CompressionType.None ? "Uncompressed" : compressionType.ToString(); + var msg = $"{type} blockInfo decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {uncompressedSize} bytes."; var exMsg = compressionType > CompressionType.Lz4HC || customBlockInfoCompression != CompressionType.Auto ? "Wrong compression type or blockInfo data might be encrypted." : "BlockInfo data might be encrypted."; @@ -491,7 +492,8 @@ namespace AssetStudio if (numWrite != blockInfo.uncompressedSize) { - var msg = $"{compressionType} block decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {blockInfo.uncompressedSize} bytes."; + var type = compressionType == CompressionType.None ? "Uncompressed" : compressionType.ToString(); + var msg = $"{type} block decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {blockInfo.uncompressedSize} bytes."; var exMsg = compressionType > CompressionType.Lz4HC || customBlockCompression != CompressionType.Auto ? "Wrong compression type or block data might be encrypted." : "Block data might be encrypted."; diff --git a/AssetStudio/CustomOptions/ImportOptions.cs b/AssetStudio/CustomOptions/ImportOptions.cs index 1d3a566..3b35175 100644 --- a/AssetStudio/CustomOptions/ImportOptions.cs +++ b/AssetStudio/CustomOptions/ImportOptions.cs @@ -87,7 +87,7 @@ namespace AssetStudio.CustomOptions { throw new NotSupportedException("Specified Unity version is not in a correct format.\n" + "Specify full Unity version, including letters at the end.\n" + - "Example: 2017.4.39f1"); + "Example: 2022.3.2f1"); } _customUnityVer = value; UnityVersionChanged?.Invoke(this, EventArgs.Empty); diff --git a/AssetStudio/FileReader.cs b/AssetStudio/FileReader.cs index 5a0d317..8947d43 100644 --- a/AssetStudio/FileReader.cs +++ b/AssetStudio/FileReader.cs @@ -13,7 +13,7 @@ namespace AssetStudio private static readonly byte[] brotliMagic = { 0x62, 0x72, 0x6F, 0x74, 0x6C, 0x69 }; private static readonly byte[] zipMagic = { 0x50, 0x4B, 0x03, 0x04 }; private static readonly byte[] zipSpannedMagic = { 0x50, 0x4B, 0x07, 0x08 }; - private static readonly byte[] unityFsMagic = {0x55, 0x6E, 0x69, 0x74, 0x79, 0x46, 0x53, 0x00}; + private static readonly byte[] unityFsMagic = { 0x55, 0x6E, 0x69, 0x74, 0x79, 0x46, 0x53, 0x00 }; private static readonly int headerBuffLen = 1152; private static byte[] headerBuff = new byte[headerBuffLen]; diff --git a/AssetStudio/SerializedFile.cs b/AssetStudio/SerializedFile.cs index 9e35606..f1f749e 100644 --- a/AssetStudio/SerializedFile.cs +++ b/AssetStudio/SerializedFile.cs @@ -98,8 +98,7 @@ namespace AssetStudio return; } version = assetsManager.Options.CustomUnityVersion; - reader.Position = versionPos; - reader.ReadBytes(version.ToString().Length + 1); + reader.Position = versionPos + version.ToString().Length + 1; } } if (header.m_Version >= SerializedFileFormatVersion.Unknown_8) diff --git a/AssetStudio/TypeTreeHelper.cs b/AssetStudio/TypeTreeHelper.cs index c74fc3e..974b5aa 100644 --- a/AssetStudio/TypeTreeHelper.cs +++ b/AssetStudio/TypeTreeHelper.cs @@ -41,7 +41,7 @@ namespace AssetStudio } if (readed != reader.byteSize) { - Logger.Info($"Failed to read type, read {readed} bytes but expected {reader.byteSize} bytes"); + Logger.Info($"Failed to read type, read {reader.Position - reader.byteStart} bytes but expected {reader.byteSize} bytes"); } return sb.ToString(); diff --git a/AssetStudioCLI/Options/CLIOptions.cs b/AssetStudioCLI/Options/CLIOptions.cs index 6d71d7f..06c71f2 100644 --- a/AssetStudioCLI/Options/CLIOptions.cs +++ b/AssetStudioCLI/Options/CLIOptions.cs @@ -500,7 +500,7 @@ namespace AssetStudioCLI.Options ( optionDefaultValue: "temp", optionName: "--cache-dir ", - optionDescription: "Specify a directory for storing temporary files. Default: .\n", + optionDescription: "Specify a directory for storing temporary files (default: program folder)\n", optionExample: "", optionHelpGroup: HelpGroups.Import ); @@ -574,7 +574,7 @@ namespace AssetStudioCLI.Options ); o_stripPathPrefix = new GroupedOption ( - optionDefaultValue: "", + optionDefaultValue: null, optionName: "--strip-path-prefix ", optionDescription: "Specify a path prefix to be stripped from exported asset paths\n", optionExample: "Example: \"--strip-path-prefix assets/models/char/\"\n", diff --git a/AssetStudioCLI/ParallelExporter.cs b/AssetStudioCLI/ParallelExporter.cs index 584c7b4..7ed268b 100644 --- a/AssetStudioCLI/ParallelExporter.cs +++ b/AssetStudioCLI/ParallelExporter.cs @@ -96,6 +96,7 @@ namespace AssetStudioCLI return true; } } + Logger.Error($"Failed to convert sprite \"{item.Text}\" into image"); return false; } diff --git a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs index a1116c5..e4c9a3c 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.Designer.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.Designer.cs @@ -1456,18 +1456,18 @@ // // unityVersionStatusLabel // + this.unityVersionStatusLabel.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.unityVersionStatusLabel.BackColor = System.Drawing.Color.Transparent; - this.unityVersionStatusLabel.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) - | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); + this.unityVersionStatusLabel.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom; this.unityVersionStatusLabel.BorderStyle = System.Windows.Forms.Border3DStyle.Etched; this.unityVersionStatusLabel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.unityVersionStatusLabel.DoubleClickEnabled = true; - this.unityVersionStatusLabel.Margin = new System.Windows.Forms.Padding(0, 3, 6, 0); + this.unityVersionStatusLabel.Margin = new System.Windows.Forms.Padding(0, 2, 6, 1); this.unityVersionStatusLabel.Name = "unityVersionStatusLabel"; + this.unityVersionStatusLabel.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; this.unityVersionStatusLabel.Size = new System.Drawing.Size(40, 19); this.unityVersionStatusLabel.Text = "None"; - this.unityVersionStatusLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.unityVersionStatusLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter; this.unityVersionStatusLabel.ToolTipText = "Custom Unity version\r\n- Double click to reset"; this.unityVersionStatusLabel.DoubleClick += new System.EventHandler(this.unityVersionStatusLabel_DoubleClick); // diff --git a/AssetStudioGUI/AssetStudioGUIForm.cs b/AssetStudioGUI/AssetStudioGUIForm.cs index 572abc5..cee4904 100644 --- a/AssetStudioGUI/AssetStudioGUIForm.cs +++ b/AssetStudioGUI/AssetStudioGUIForm.cs @@ -2544,7 +2544,6 @@ namespace AssetStudioGUI if (isDarkMode) { assetListView.GridLines = false; - unityVersionStatusLabel.BorderStyle = Border3DStyle.SunkenInner; } else { diff --git a/AssetStudioGUI/ParallelExport.cs b/AssetStudioGUI/ParallelExport.cs index 212bffe..8b15455 100644 --- a/AssetStudioGUI/ParallelExport.cs +++ b/AssetStudioGUI/ParallelExport.cs @@ -95,6 +95,7 @@ namespace AssetStudioGUI return true; } } + Logger.Warning($"Failed to convert sprite \"{item.Text}\" into image"); return false; } diff --git a/AssetStudioGUI/Studio.cs b/AssetStudioGUI/Studio.cs index d9dc7b0..4ede476 100644 --- a/AssetStudioGUI/Studio.cs +++ b/AssetStudioGUI/Studio.cs @@ -675,11 +675,11 @@ namespace AssetStudioGUI if (GUILogger.ShowDebugMessage) { Logger.Debug(debugLog); - StatusStripUpdate($"[{exportedCount}/{toExportCount}] Exporting {asset.TypeString}: {asset.Text}"); + StatusStripUpdate($"[{exportedCount}/{toExportCount}] Exported {asset.TypeString}: {asset.Text}"); } else { - Logger.Info($"[{exportedCount}/{toExportCount}] Exporting {asset.TypeString}: {asset.Text}"); + Logger.Info($"[{exportedCount}/{toExportCount}] Exported {asset.TypeString}: {asset.Text}"); } } Interlocked.Increment(ref i);