mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01:00
feat: missing icon handling
This commit is contained in:
1 parent
9dfa5a7693
commit
b0d7a49b16
1 file changed
+21
-5
@@ -216,12 +216,28 @@ 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"));
|
|
||||||
|
|
||||||
await assetUploader.Add(new($"tanks/{id}/icons/small.png", smallIcon));
|
if (smallIconTexture is null)
|
||||||
await assetUploader.Add(new($"tanks/{id}/icons/big.png", bigIcon));
|
{
|
||||||
|
PrettyLog.Warn($"Small icon missing for {id}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var smallIcon = BlitzKitExporter.Texture2D(smallIconTexture);
|
||||||
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task MangleHull(UObject pda)
|
async Task MangleHull(UObject pda)
|
||||||
|
|||||||
Reference in new issue
Block a user