mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: reading some files
This commit is contained in:
1 parent
ff02f06cbc
commit
728cb43f05
4 files changed
+58
-4
No files matched your search
Vendored
+2
@@ -145,6 +145,7 @@
|
||||
"noout",
|
||||
"normalmap",
|
||||
"oneof",
|
||||
"Oodle",
|
||||
"oopsies",
|
||||
"Oopsy",
|
||||
"opentest",
|
||||
@@ -231,6 +232,7 @@
|
||||
"unrotate",
|
||||
"unwrapper",
|
||||
"userns",
|
||||
"usmap",
|
||||
"vercel",
|
||||
"vickers",
|
||||
"vitepress",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"license": "BlitzKit License",
|
||||
"private": true,
|
||||
"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:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
||||
"build:bot": "cd packages/scripts && bun run build:bot",
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "dotnet build"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-api-dotnet": "^0.9.19"
|
||||
}
|
||||
|
||||
@@ -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 Microsoft.JavaScript.NodeApi;
|
||||
|
||||
@@ -19,10 +22,37 @@ public class BlitzProvider
|
||||
searchOption: SearchOption.AllDirectories,
|
||||
versions: new(EGame.GAME_UE5_5),
|
||||
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||
);
|
||||
)
|
||||
{
|
||||
MappingsContainer = new FileUsmapTypeMappingsProvider("../../packages/closed/blitz.usmap"),
|
||||
};
|
||||
|
||||
provider.Initialize();
|
||||
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}");
|
||||
|
||||
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];
|
||||
|
||||
var tanksBase = "Blitz/Content/Tanks/";
|
||||
@@ -42,6 +72,25 @@ public class BlitzProvider
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user