mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-11-12 23:32:42 -05:00
[CLI] Add flag to always decompress bundles to disk
This commit is contained in:
@ -124,6 +124,7 @@ namespace AssetStudioCLI.Options
|
|||||||
public static Option<ExportListType> o_exportAssetList;
|
public static Option<ExportListType> o_exportAssetList;
|
||||||
public static Option<string> o_assemblyPath;
|
public static Option<string> o_assemblyPath;
|
||||||
public static Option<UnityVersion> o_unityVersion;
|
public static Option<UnityVersion> o_unityVersion;
|
||||||
|
public static Option<bool> f_decompressToDisk;
|
||||||
public static Option<bool> f_notRestoreExtensionName;
|
public static Option<bool> f_notRestoreExtensionName;
|
||||||
public static Option<bool> f_avoidLoadingViaTypetree;
|
public static Option<bool> f_avoidLoadingViaTypetree;
|
||||||
public static Option<bool> f_loadAllAssets;
|
public static Option<bool> f_loadAllAssets;
|
||||||
@ -518,6 +519,15 @@ namespace AssetStudioCLI.Options
|
|||||||
optionExample: "Example: \"--unity-version 2017.4.39f1\"\n",
|
optionExample: "Example: \"--unity-version 2017.4.39f1\"\n",
|
||||||
optionHelpGroup: HelpGroups.Advanced
|
optionHelpGroup: HelpGroups.Advanced
|
||||||
);
|
);
|
||||||
|
f_decompressToDisk = new GroupedOption<bool>
|
||||||
|
(
|
||||||
|
optionDefaultValue: false,
|
||||||
|
optionName: "--decompress-to-disk",
|
||||||
|
optionDescription: "(Flag) If not specified, only bundles larger than 2GB will be decompressed to disk\ninstead of memory\n",
|
||||||
|
optionExample: "",
|
||||||
|
optionHelpGroup: HelpGroups.Advanced,
|
||||||
|
isFlag: true
|
||||||
|
);
|
||||||
f_notRestoreExtensionName = new GroupedOption<bool>
|
f_notRestoreExtensionName = new GroupedOption<bool>
|
||||||
(
|
(
|
||||||
optionDefaultValue: false,
|
optionDefaultValue: false,
|
||||||
@ -661,11 +671,12 @@ namespace AssetStudioCLI.Options
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Parse Flags
|
#region Parse Flags
|
||||||
|
var flagIndexes = new List<int>();
|
||||||
for (var i = 0; i < processedArgs.Count; i++)
|
for (var i = 0; i < processedArgs.Count; i++)
|
||||||
{
|
{
|
||||||
var flag = processedArgs[i].ToLower();
|
var flag = processedArgs[i].ToLower();
|
||||||
|
|
||||||
switch(flag)
|
switch (flag)
|
||||||
{
|
{
|
||||||
case "--l2d-search-by-filename":
|
case "--l2d-search-by-filename":
|
||||||
if (o_workMode.Value != WorkMode.Live2D)
|
if (o_workMode.Value != WorkMode.Live2D)
|
||||||
@ -675,7 +686,7 @@ namespace AssetStudioCLI.Options
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
f_l2dAssetSearchByFilename.Value = true;
|
f_l2dAssetSearchByFilename.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--l2d-force-bezier":
|
case "--l2d-force-bezier":
|
||||||
if (o_workMode.Value != WorkMode.Live2D)
|
if (o_workMode.Value != WorkMode.Live2D)
|
||||||
@ -685,7 +696,7 @@ namespace AssetStudioCLI.Options
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
f_l2dForceBezier.Value = true;
|
f_l2dForceBezier.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--fbx-uvs-as-diffuse":
|
case "--fbx-uvs-as-diffuse":
|
||||||
if (o_workMode.Value != WorkMode.SplitObjects)
|
if (o_workMode.Value != WorkMode.SplitObjects)
|
||||||
@ -695,19 +706,23 @@ namespace AssetStudioCLI.Options
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
f_fbxUvsAsDiffuseMaps.Value = true;
|
f_fbxUvsAsDiffuseMaps.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--filter-with-regex":
|
case "--filter-with-regex":
|
||||||
f_filterWithRegex.Value = true;
|
f_filterWithRegex.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
|
break;
|
||||||
|
case "--decompress-to-disk":
|
||||||
|
f_decompressToDisk.Value = true;
|
||||||
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--not-restore-extension":
|
case "--not-restore-extension":
|
||||||
f_notRestoreExtensionName.Value = true;
|
f_notRestoreExtensionName.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--avoid-typetree-loading":
|
case "--avoid-typetree-loading":
|
||||||
f_avoidLoadingViaTypetree.Value = true;
|
f_avoidLoadingViaTypetree.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
case "--load-all":
|
case "--load-all":
|
||||||
switch (o_workMode.Value)
|
switch (o_workMode.Value)
|
||||||
@ -716,7 +731,7 @@ namespace AssetStudioCLI.Options
|
|||||||
case WorkMode.Dump:
|
case WorkMode.Dump:
|
||||||
case WorkMode.Info:
|
case WorkMode.Info:
|
||||||
f_loadAllAssets.Value = true;
|
f_loadAllAssets.Value = true;
|
||||||
processedArgs.RemoveAt(i);
|
flagIndexes.Add(i);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{flag.Color(brightYellow)}] flag. This flag is not suitable for the current working mode [{o_workMode.Value}].\n");
|
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{flag.Color(brightYellow)}] flag. This flag is not suitable for the current working mode [{o_workMode.Value}].\n");
|
||||||
@ -726,6 +741,10 @@ namespace AssetStudioCLI.Options
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (var i = 0; i < flagIndexes.Count; i++)
|
||||||
|
{
|
||||||
|
processedArgs.RemoveAt(flagIndexes[i] - i);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Parse Options
|
#region Parse Options
|
||||||
@ -1366,6 +1385,7 @@ namespace AssetStudioCLI.Options
|
|||||||
sb.AppendLine($"# Unity Version: {unityVer}");
|
sb.AppendLine($"# Unity Version: {unityVer}");
|
||||||
if (o_workMode.Value != WorkMode.Extract)
|
if (o_workMode.Value != WorkMode.Extract)
|
||||||
{
|
{
|
||||||
|
sb.AppendLine($"# Decompress Bundles To Disk: {f_decompressToDisk.Value}");
|
||||||
sb.AppendLine($"# Parse Assets Using TypeTree: {!f_avoidLoadingViaTypetree.Value}");
|
sb.AppendLine($"# Parse Assets Using TypeTree: {!f_avoidLoadingViaTypetree.Value}");
|
||||||
sb.AppendLine($"# Export Asset List: {o_exportAssetList}");
|
sb.AppendLine($"# Export Asset List: {o_exportAssetList}");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,7 @@ namespace AssetStudioCLI
|
|||||||
assetsManager.Options.CustomUnityVersion = CLIOptions.o_unityVersion.Value;
|
assetsManager.Options.CustomUnityVersion = CLIOptions.o_unityVersion.Value;
|
||||||
assetsManager.Options.BundleOptions.CustomBlockInfoCompression = CLIOptions.o_bundleBlockInfoCompression.Value;
|
assetsManager.Options.BundleOptions.CustomBlockInfoCompression = CLIOptions.o_bundleBlockInfoCompression.Value;
|
||||||
assetsManager.Options.BundleOptions.CustomBlockCompression = CLIOptions.o_bundleBlockCompression.Value;
|
assetsManager.Options.BundleOptions.CustomBlockCompression = CLIOptions.o_bundleBlockCompression.Value;
|
||||||
|
assetsManager.Options.BundleOptions.DecompressToDisk = CLIOptions.f_decompressToDisk.Value;
|
||||||
assetsManager.OptionLoaders.Clear();
|
assetsManager.OptionLoaders.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user