Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
- [CLI] allow exported flags to override configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Razmoth committed Feb 20, 2024
1 parent 55fcd60 commit ab73046
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions AssetStudio.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public static void Run(Options o)
var classTypeFilter = Array.Empty<ClassIDType>();
if (!o.TypeFilter.IsNullOrEmpty())
{
var exportTexture2D = false;
var exportMaterial = false;
var classTypeFilterList = new List<ClassIDType>();
for (int i = 0; i < o.TypeFilter.Length; i++)
{
Expand All @@ -70,6 +72,15 @@ public static void Run(Options o)
}

type = (ClassIDType)Enum.Parse(typeof(ClassIDType), typeStr, true);

if (type == ClassIDType.Texture2D)
{
exportTexture2D = flag.HasFlag(TypeFlag.Export);
}
else if (type == ClassIDType.Material)
{
exportMaterial = flag.HasFlag(TypeFlag.Export);
}

TypeFlags.SetType(type, flag.HasFlag(TypeFlag.Parse), flag.HasFlag(TypeFlag.Export));

Expand All @@ -86,10 +97,10 @@ public static void Run(Options o)

if (ClassIDType.GameObject.CanExport() || ClassIDType.Animator.CanExport())
{
TypeFlags.SetType(ClassIDType.Texture2D, true, false);
TypeFlags.SetType(ClassIDType.Texture2D, true, exportTexture2D);
if (Settings.Default.exportMaterials)
{
TypeFlags.SetType(ClassIDType.Material, true, false);
TypeFlags.SetType(ClassIDType.Material, true, exportMaterial);
}
if (ClassIDType.GameObject.CanExport())
{
Expand Down

0 comments on commit ab73046

Please sign in to comment.