mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
[GUI] Add more details to log when exporting assets
This commit is contained in:
parent
5c24183d18
commit
3ec8169b08
@ -448,6 +448,7 @@ namespace AssetStudioGUI
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
Progress.Reset();
|
Progress.Reset();
|
||||||
var groupOption = (AssetGroupOption)Properties.Settings.Default.assetGroupOption;
|
var groupOption = (AssetGroupOption)Properties.Settings.Default.assetGroupOption;
|
||||||
|
var mode = exportType == ExportType.Dump ? "Dump" : "Export";
|
||||||
foreach (var asset in toExportAssets)
|
foreach (var asset in toExportAssets)
|
||||||
{
|
{
|
||||||
string exportPath;
|
string exportPath;
|
||||||
@ -496,41 +497,41 @@ namespace AssetStudioGUI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
exportPath += Path.DirectorySeparatorChar;
|
exportPath += Path.DirectorySeparatorChar;
|
||||||
var mode = exportType == ExportType.Dump ? "Dumping" : "Exporting";
|
Logger.Info($"[{exportedCount + 1}/{toExportCount}] {mode}ing {asset.TypeString}: {asset.Text}");
|
||||||
Logger.Info($"[{exportedCount + 1}/{toExportCount}] {mode} {asset.TypeString}: {asset.Text}");
|
var isExported = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
switch (exportType)
|
switch (exportType)
|
||||||
{
|
{
|
||||||
case ExportType.Raw:
|
case ExportType.Raw:
|
||||||
if (ExportRawFile(asset, exportPath))
|
isExported = ExportRawFile(asset, exportPath);
|
||||||
{
|
|
||||||
exportedCount++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ExportType.Dump:
|
case ExportType.Dump:
|
||||||
if (ExportDumpFile(asset, exportPath))
|
isExported = ExportDumpFile(asset, exportPath);
|
||||||
{
|
|
||||||
exportedCount++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ExportType.Convert:
|
case ExportType.Convert:
|
||||||
if (ExportConvertFile(asset, exportPath))
|
isExported = ExportConvertFile(asset, exportPath);
|
||||||
{
|
|
||||||
exportedCount++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error($"Export {asset.Type}:{asset.Text} error", ex);
|
Logger.Error($"{mode} {asset.TypeString}: {asset.Text} error", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isExported)
|
||||||
|
{
|
||||||
|
exportedCount++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Warning($"Unable to {mode.ToLower()} {asset.TypeString}: {asset.Text}");
|
||||||
}
|
}
|
||||||
|
|
||||||
Progress.Report(++i, toExportCount);
|
Progress.Report(++i, toExportCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
var statusText = exportedCount == 0 ? "Nothing exported." : $"Finished exporting {exportedCount} assets.";
|
var statusText = exportedCount == 0 ? "Nothing exported." : $"Finished {mode.ToLower()}ing {exportedCount} assets.";
|
||||||
|
|
||||||
if (toExportCount > exportedCount)
|
if (toExportCount > exportedCount)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user