feat: missing icon handling

This commit is contained in:
tresabhi committed 2025-03-06 21:49:17 -06:00
1 parent 9dfa5a7693
commit b0d7a49b16
1 file changed
+19 -3
+19 -3
View File
@@ -216,13 +216,29 @@ namespace BlitzKit.CLI.Functions
async Task MangleIcon(UObject pda) async Task MangleIcon(UObject pda)
{ {
var id = PropertyUtil.Get<FName>(pda, "TankId").Text; var id = PropertyUtil.Get<FName>(pda, "TankId").Text;
var smallIcon = BlitzKitExporter.Texture2D(PropertyUtil.Get<UTexture2D>(pda, "SmallIcon")); PropertyUtil.TryGet<UTexture2D>(pda, "SmallIcon", out var smallIconTexture);
Console.WriteLine(id); PropertyUtil.TryGet<UTexture2D>(pda, "BigIcon", out var bigIconTexture);
var bigIcon = BlitzKitExporter.Texture2D(PropertyUtil.Get<UTexture2D>(pda, "BigIcon"));
if (smallIconTexture is null)
{
PrettyLog.Warn($"Small icon missing for {id}");
}
else
{
var smallIcon = BlitzKitExporter.Texture2D(smallIconTexture);
await assetUploader.Add(new($"tanks/{id}/icons/small.png", smallIcon)); await assetUploader.Add(new($"tanks/{id}/icons/small.png", smallIcon));
}
if (bigIconTexture is null)
{
PrettyLog.Warn($"Big icon missing for {id}");
}
else
{
var bigIcon = BlitzKitExporter.Texture2D(bigIconTexture);
await assetUploader.Add(new($"tanks/{id}/icons/big.png", bigIcon)); await assetUploader.Add(new($"tanks/{id}/icons/big.png", bigIcon));
} }
}
async Task MangleHull(UObject pda) async Task MangleHull(UObject pda)
{ {