Merge branch 'pr/113' into AssetStudioMod

This commit is contained in:
VaDiM
2026-03-05 03:03:22 +03:00
3 changed files with 80 additions and 3 deletions
+39 -2
View File
@@ -627,6 +627,14 @@ namespace AssetStudioCLI
);
break;
}
if (CLIOptions.f_filterExcludeMode.Value)
{
var excludeCount = assetsCount - filteredAssets.Count;
Logger.Info($"Excluding {excludeCount} asset(s) that match the filter.");
filteredAssets = parsedAssetsList.Except(filteredAssets).ToList();
}
parsedAssetsList.Clear();
parsedAssetsList = filteredAssets;
}
@@ -641,6 +649,31 @@ namespace AssetStudioCLI
var parallelExportCount = CLIOptions.o_maxParallelExportTasks.Value;
var toExportAssetDict = new ConcurrentDictionary<AssetItem, string>();
var toParallelExportAssetDict = new ConcurrentDictionary<AssetItem, string>();
if (CLIOptions.o_stripPathPrefix.Value != null)
{
foreach (var asset in parsedAssetsList)
{
var containerPath = asset.Container;
if (string.IsNullOrEmpty(containerPath))
{
continue;
}
if (!Path.Combine(Path.GetDirectoryName(containerPath), Path.GetFileName(containerPath)).StartsWith(CLIOptions.o_stripPathPrefix.Value))
{
Logger.Warning($"Asset container path \"{asset.Container}\" does not start with the specified path prefix \"{CLIOptions.o_stripPathPrefix.Value}\"");
Logger.Warning("strip path prefix option will be ignored.");
CLIOptions.o_stripPathPrefix.Value = null;
break;
}
}
}
if (CLIOptions.o_stripPathPrefix.Value != null)
{
Logger.Info($"Asset container path prefix \"{CLIOptions.o_stripPathPrefix.Value}\" will be stripped off.");
}
Parallel.ForEach(parsedAssetsList, asset =>
{
string exportPath;
@@ -653,7 +686,12 @@ namespace AssetStudioCLI
case AssetGroupOption.ContainerPathFull:
if (!string.IsNullOrEmpty(asset.Container))
{
exportPath = Path.Combine(savePath, Path.GetDirectoryName(asset.Container));
var containerPath = Path.GetDirectoryName(asset.Container);
if (CLIOptions.o_stripPathPrefix.Value != null)
{
containerPath = containerPath.Substring(CLIOptions.o_stripPathPrefix.Value.Length);
}
exportPath = Path.Combine(savePath, containerPath);
if (groupOption == AssetGroupOption.ContainerPathFull)
{
exportPath = Path.Combine(exportPath, Path.GetFileNameWithoutExtension(asset.Container));
@@ -722,7 +760,6 @@ namespace AssetStudioCLI
toExportAssetDict.TryAdd(asset, exportPath);
}
});
foreach (var toExportAsset in toExportAssetDict)
{
var asset = toExportAsset.Key;