mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
Add option to disable asset loading via typetree
This commit is contained in:
@ -116,6 +116,7 @@ namespace AssetStudioCLI.Options
|
||||
public static Option<string> o_assemblyPath;
|
||||
public static Option<string> o_unityVersion;
|
||||
public static Option<bool> f_notRestoreExtensionName;
|
||||
public static Option<bool> f_avoidLoadingViaTypetree;
|
||||
public static Option<bool> f_loadAllAssets;
|
||||
|
||||
static CLIOptions()
|
||||
@ -431,6 +432,15 @@ namespace AssetStudioCLI.Options
|
||||
optionHelpGroup: HelpGroups.Advanced,
|
||||
isFlag: true
|
||||
);
|
||||
f_avoidLoadingViaTypetree = new GroupedOption<bool>
|
||||
(
|
||||
optionDefaultValue: false,
|
||||
optionName: "--avoid-typetree-loading",
|
||||
optionDescription: "(Flag) If specified, AssetStudio will not try to load assets using their type tree\n",
|
||||
optionExample: "",
|
||||
optionHelpGroup: HelpGroups.Advanced,
|
||||
isFlag: true
|
||||
);
|
||||
f_loadAllAssets = new GroupedOption<bool>
|
||||
(
|
||||
optionDefaultValue: false,
|
||||
@ -553,10 +563,24 @@ namespace AssetStudioCLI.Options
|
||||
|
||||
switch(flag)
|
||||
{
|
||||
case "--l2d-force-bezier":
|
||||
if (o_workMode.Value != WorkMode.ExportLive2D)
|
||||
{
|
||||
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");
|
||||
ShowOptionDescription(o_workMode);
|
||||
return;
|
||||
}
|
||||
f_l2dForceBezier.Value = true;
|
||||
resplittedArgs.RemoveAt(i);
|
||||
break;
|
||||
case "--not-restore-extension":
|
||||
f_notRestoreExtensionName.Value = true;
|
||||
resplittedArgs.RemoveAt(i);
|
||||
break;
|
||||
case "--avoid-typetree-loading":
|
||||
f_avoidLoadingViaTypetree.Value = true;
|
||||
resplittedArgs.RemoveAt(i);
|
||||
break;
|
||||
case "--load-all":
|
||||
switch (o_workMode.Value)
|
||||
{
|
||||
@ -572,16 +596,6 @@ namespace AssetStudioCLI.Options
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "--l2d-force-bezier":
|
||||
if (o_workMode.Value != WorkMode.ExportLive2D)
|
||||
{
|
||||
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");
|
||||
ShowOptionDescription(o_workMode);
|
||||
return;
|
||||
}
|
||||
f_l2dForceBezier.Value = true;
|
||||
resplittedArgs.RemoveAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -1083,6 +1097,7 @@ namespace AssetStudioCLI.Options
|
||||
{
|
||||
sb.AppendLine($"# Custom Compression Type: {o_customCompressionType}");
|
||||
}
|
||||
sb.AppendLine($"# Load Assets via Typetree: {!f_avoidLoadingViaTypetree.Value}");
|
||||
sb.AppendLine($"# Input Path: \"{inputPath}\"");
|
||||
switch (o_workMode.Value)
|
||||
{
|
||||
|
@ -35,6 +35,7 @@ namespace AssetStudioCLI
|
||||
var isLoaded = false;
|
||||
assetsManager.SpecifyUnityVersion = CLIOptions.o_unityVersion.Value;
|
||||
assetsManager.ZstdEnabled = CLIOptions.o_customCompressionType.Value == CustomCompressionType.Zstd;
|
||||
assetsManager.LoadingViaTypeTreeEnabled = !CLIOptions.f_avoidLoadingViaTypetree.Value;
|
||||
if (!CLIOptions.f_loadAllAssets.Value)
|
||||
{
|
||||
assetsManager.SetAssetFilter(CLIOptions.o_exportAssetTypes.Value);
|
||||
|
Reference in New Issue
Block a user