mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +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",
|
"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
@@ -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",
|
||||||
|
|||||||
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,10 +22,37 @@ 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}");
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
var tanksBase = "Blitz/Content/Tanks/";
|
var tanksBase = "Blitz/Content/Tanks/";
|
||||||
@@ -42,6 +72,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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user