mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
Add grouping option with full container path
* [GUI] - "container path full (with name)" * [CLI] - "containerFull" (https://github.com/Perfare/AssetStudio/issues/815)
This commit is contained in:
3
AssetStudioGUI/ExportOptions.Designer.cs
generated
3
AssetStudioGUI/ExportOptions.Designer.cs
generated
@ -154,11 +154,12 @@
|
||||
this.assetGroupOptions.Items.AddRange(new object[] {
|
||||
"type name",
|
||||
"container path",
|
||||
"container path full (with name)",
|
||||
"source file name",
|
||||
"do not group"});
|
||||
this.assetGroupOptions.Location = new System.Drawing.Point(6, 35);
|
||||
this.assetGroupOptions.Name = "assetGroupOptions";
|
||||
this.assetGroupOptions.Size = new System.Drawing.Size(149, 21);
|
||||
this.assetGroupOptions.Size = new System.Drawing.Size(165, 21);
|
||||
this.assetGroupOptions.TabIndex = 8;
|
||||
//
|
||||
// label6
|
||||
|
@ -32,6 +32,14 @@ namespace AssetStudioGUI
|
||||
XML
|
||||
}
|
||||
|
||||
internal enum AssetGroupOption
|
||||
{
|
||||
TypeName,
|
||||
ContainerPath,
|
||||
ContainerPathFull,
|
||||
SourceFileName
|
||||
}
|
||||
|
||||
internal enum ListSearchFilterMode
|
||||
{
|
||||
Include,
|
||||
@ -389,25 +397,31 @@ namespace AssetStudioGUI
|
||||
int exportedCount = 0;
|
||||
int i = 0;
|
||||
Progress.Reset();
|
||||
var groupOption = (AssetGroupOption)Properties.Settings.Default.assetGroupOption;
|
||||
foreach (var asset in toExportAssets)
|
||||
{
|
||||
string exportPath;
|
||||
switch (Properties.Settings.Default.assetGroupOption)
|
||||
switch (groupOption)
|
||||
{
|
||||
case 0: //type name
|
||||
case AssetGroupOption.TypeName:
|
||||
exportPath = Path.Combine(savePath, asset.TypeString);
|
||||
break;
|
||||
case 1: //container path
|
||||
case AssetGroupOption.ContainerPath:
|
||||
case AssetGroupOption.ContainerPathFull:
|
||||
if (!string.IsNullOrEmpty(asset.Container))
|
||||
{
|
||||
exportPath = Path.Combine(savePath, Path.GetDirectoryName(asset.Container));
|
||||
if (groupOption == AssetGroupOption.ContainerPathFull)
|
||||
{
|
||||
exportPath = Path.Combine(exportPath, Path.GetFileNameWithoutExtension(asset.Container));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
exportPath = savePath;
|
||||
}
|
||||
break;
|
||||
case 2: //source file
|
||||
case AssetGroupOption.SourceFileName:
|
||||
if (string.IsNullOrEmpty(asset.SourceFile.originalPath))
|
||||
{
|
||||
exportPath = Path.Combine(savePath, asset.SourceFile.fileName + "_export");
|
||||
|
Reference in New Issue
Block a user