Some other fixes

This commit is contained in:
VaDiM
2026-04-24 12:03:58 +03:00
parent c728d0349d
commit bd93a9f5d6
11 changed files with 23 additions and 21 deletions
+8 -6
View File
@@ -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.";
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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];
+1 -2
View File
@@ -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)
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -500,7 +500,7 @@ namespace AssetStudioCLI.Options
(
optionDefaultValue: "temp",
optionName: "--cache-dir <path>",
optionDescription: "Specify a directory for storing temporary files. Default: <program folder>.\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<string>
(
optionDefaultValue: "",
optionDefaultValue: null,
optionName: "--strip-path-prefix <path>",
optionDescription: "Specify a path prefix to be stripped from exported asset paths\n",
optionExample: "Example: \"--strip-path-prefix assets/models/char/\"\n",
+1
View File
@@ -96,6 +96,7 @@ namespace AssetStudioCLI
return true;
}
}
Logger.Error($"Failed to convert sprite \"{item.Text}\" into image");
return false;
}
+5 -5
View File
@@ -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);
//
-1
View File
@@ -2544,7 +2544,6 @@ namespace AssetStudioGUI
if (isDarkMode)
{
assetListView.GridLines = false;
unityVersionStatusLabel.BorderStyle = Border3DStyle.SunkenInner;
}
else
{
+1
View File
@@ -95,6 +95,7 @@ namespace AssetStudioGUI
return true;
}
}
Logger.Warning($"Failed to convert sprite \"{item.Text}\" into image");
return false;
}
+2 -2
View File
@@ -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);