Compare commits

...
2 Commits
Author SHA1 Message Date
TrèsAbhi 0b7f717057 feat: cue4parse submodule 2026-02-01 21:34:03 -06:00
TrèsAbhi 728cb43f05 feat: reading some files 2026-02-01 21:05:38 -06:00
7 changed files with 71 additions and 5 deletions

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
[submodule "packages/closed"] [submodule "packages/closed"]
path = packages/closed path = packages/closed
url = https://github.com/blitzkit/closed.git url = https://github.com/blitzkit/closed.git
[submodule "packages/cue4parse"]
path = packages/cue4parse
url = https://github.com/FabianFG/CUE4Parse.git
+2
View File
@@ -145,6 +145,7 @@
"noout", "noout",
"normalmap", "normalmap",
"oneof", "oneof",
"Oodle",
"oopsies", "oopsies",
"Oopsy", "Oopsy",
"opentest", "opentest",
@@ -231,6 +232,7 @@
"unrotate", "unrotate",
"unwrapper", "unwrapper",
"userns", "userns",
"usmap",
"vercel", "vercel",
"vickers", "vickers",
"vitepress", "vitepress",
+1 -1
View File
@@ -4,7 +4,7 @@
"license": "BlitzKit License", "license": "BlitzKit License",
"private": true, "private": true,
"scripts": { "scripts": {
"build:game": "cd packages/game && dotnet build", "build:game": "cd packages/game && bun run build",
"build:assets": "cd packages/scripts && bun run build:assets", "build:assets": "cd packages/scripts && bun run build:assets",
"build:averages": "bun --filter=@blitzkit/scripts run build:averages", "build:averages": "bun --filter=@blitzkit/scripts run build:averages",
"build:bot": "cd packages/scripts && bun run build:bot", "build:bot": "cd packages/scripts && bun run build:bot",
Submodule packages/cue4parse added at bf5380789b.
+1 -1
View File
@@ -7,7 +7,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CUE4Parse" Version="1.2.2" /> <ProjectReference Include="../cue4parse/CUE4Parse/CUE4Parse.csproj" />
<PackageReference Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" /> <PackageReference Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" />
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.19" /> <PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.19" />
</ItemGroup> </ItemGroup>
+3
View File
@@ -3,6 +3,9 @@
"private": true, "private": true,
"type": "module", "type": "module",
"main": "src/index.ts", "main": "src/index.ts",
"scripts": {
"build": "dotnet build"
},
"dependencies": { "dependencies": {
"node-api-dotnet": "^0.9.19" "node-api-dotnet": "^0.9.19"
} }
+60 -3
View File
@@ -1,4 +1,7 @@
using CUE4Parse.FileProvider; using System.Runtime.InteropServices;
using CUE4Parse.Compression;
using CUE4Parse.FileProvider;
using CUE4Parse.MappingsProvider;
using CUE4Parse.UE4.Versions; using CUE4Parse.UE4.Versions;
using Microsoft.JavaScript.NodeApi; using Microsoft.JavaScript.NodeApi;
@@ -19,12 +22,47 @@ public class BlitzProvider
searchOption: SearchOption.AllDirectories, searchOption: SearchOption.AllDirectories,
versions: new(EGame.GAME_UE5_5), versions: new(EGame.GAME_UE5_5),
pathComparer: StringComparer.OrdinalIgnoreCase pathComparer: StringComparer.OrdinalIgnoreCase
); )
{
MappingsContainer = new FileUsmapTypeMappingsProvider("../../packages/closed/blitz.usmap"),
};
provider.Initialize(); provider.Initialize();
provider.Mount(); provider.Mount();
string libraryExtension;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
libraryExtension = "dll";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
libraryExtension = "so";
}
else
{
throw new Exception("Unsupported OS");
}
OodleHelper.DownloadOodleDll($"temp/oodle.{libraryExtension}");
OodleHelper.Initialize($"temp/oodle.{libraryExtension}");
// Console.WriteLine(
// provider.Files.Keys.Contains(
// "Blitz/Content/Tanks/USA/A97_M41_Bulldog/PDA_A97_M41_Bulldog.uasset"
// )
// );
// var pda = provider.LoadPackageObject(
// "Blitz/Content/Tanks/USA/A97_M41_Bulldog/PDA_A97_M41_Bulldog.PDA_A97_M41_Bulldog"
// );
// Console.WriteLine(pda);
files = [.. provider.Files.Keys]; files = [.. provider.Files.Keys];
Console.WriteLine(string.Join("\n", files));
var tanksBase = "Blitz/Content/Tanks/"; var tanksBase = "Blitz/Content/Tanks/";
tanksDirectoryNations = tanksDirectoryNations =
[ [
@@ -42,6 +80,25 @@ public class BlitzProvider
public byte[] TankBigIcon(string tankId, string pdaName) public byte[] TankBigIcon(string tankId, string pdaName)
{ {
return []; foreach (var nation in tanksDirectoryNations)
{
var path = $"Blitz/Content/Tanks/{nation}/{tankId}/{pdaName}.{pdaName}";
Console.WriteLine(path);
if (provider.TryLoadPackageObject(path, out var pda))
{
Console.WriteLine(pda);
Console.WriteLine(pda.GetType());
return [];
}
else
{
continue;
}
}
throw new FileNotFoundException($"Tank {tankId}/{pdaName} not found in any nation");
} }
} }