mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: parsing
This commit is contained in:
1 parent
74a8df6842
commit
d6c1e8069d
5 files changed
+98
-8
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using BlitzKit.CLI.Models;
|
||||
using BlitzKit.CLI.Utils;
|
||||
using CUE4Parse.FileProvider.Objects;
|
||||
|
||||
namespace BlitzKit.CLI.Functions
|
||||
{
|
||||
@@ -15,9 +17,52 @@ namespace BlitzKit.CLI.Functions
|
||||
|
||||
foreach (var tank in nation.Value.Directories)
|
||||
{
|
||||
if (!tank.Value.HasFile($"DA_{tank.Key}_Attributes.uasset"))
|
||||
if (tank.Key != "R90_IS_4")
|
||||
continue;
|
||||
|
||||
var attributeFileName = $"DA_{tank.Key}_Attributes.uasset";
|
||||
var hasAttributesFile = tank.Value.HasFile(attributeFileName);
|
||||
GameFile? attributes = null;
|
||||
|
||||
if (hasAttributesFile)
|
||||
{
|
||||
Console.WriteLine($"{nation.Key}/{tank.Key}");
|
||||
attributes = tank.Value.GetFile(attributeFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrettyLog.Warn(
|
||||
$"No attributes file found for {nation.Key}/{tank.Key}, it may be misspelled; finding any attributes file..."
|
||||
);
|
||||
|
||||
foreach (var file in tank.Value.Files)
|
||||
{
|
||||
if (file.Key.EndsWith("_Attributes.uasset"))
|
||||
{
|
||||
attributes = file.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attributes == null)
|
||||
{
|
||||
PrettyLog.Error(
|
||||
$"No suffixed attributes file found for {nation.Key}/{tank.Key}; skipping..."
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var objects = provider.LoadAllObjects(attributes.Path);
|
||||
var objectsCount = objects.Count();
|
||||
|
||||
if (objectsCount != 1)
|
||||
{
|
||||
throw new Exception($"Expected 1 object for attribute objects, got {objectsCount}");
|
||||
}
|
||||
|
||||
foreach (var obj in objects)
|
||||
{
|
||||
Console.WriteLine(obj.Properties);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user