feat: tanksDirectoryNations

This commit is contained in:
TrèsAbhi committed 2026-02-01 19:34:36 -06:00
1 parent 7a817cbe8c
commit ff02f06cbc
5 files changed
+26 -3

No files matched your search

+1
View File
@@ -221,6 +221,7 @@
"tungstentip", "tungstentip",
"Turretless", "Turretless",
"TYPELESS", "TYPELESS",
"uasset",
"ubjson", "ubjson",
"Unicum", "Unicum",
"UNLOCALIZED", "UNLOCALIZED",
+1
View File
@@ -4,6 +4,7 @@
"license": "BlitzKit License", "license": "BlitzKit License",
"private": true, "private": true,
"scripts": { "scripts": {
"build:game": "cd packages/game && dotnet 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
View File
@@ -0,0 +1,3 @@
[*.cs]
indent_style = space
indent_size = 2
-1
View File
@@ -4,7 +4,6 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<NodeApiAssemblyJSModuleType>esm</NodeApiAssemblyJSModuleType> <NodeApiAssemblyJSModuleType>esm</NodeApiAssemblyJSModuleType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+21 -2
View File
@@ -9,6 +9,9 @@ public class BlitzProvider
{ {
private readonly DefaultFileProvider provider; private readonly DefaultFileProvider provider;
public string[] files;
public string[] tanksDirectoryNations;
public BlitzProvider(string directory) public BlitzProvider(string directory)
{ {
provider = new( provider = new(
@@ -19,10 +22,26 @@ public class BlitzProvider
); );
provider.Initialize(); provider.Initialize();
provider.Mount(); provider.Mount();
files = [.. provider.Files.Keys];
var tanksBase = "Blitz/Content/Tanks/";
tanksDirectoryNations =
[
.. files
.Where(path => path.StartsWith(tanksBase))
.Select(path => path[tanksBase.Length..])
.Select(path => path.Split('/')[0])
.Where(nation => !nation.EndsWith(".uasset") && nation != "TankStub")
.Distinct(),
];
} }
public string[] Files() public string[] Files => files;
public string[] TanksDirectoryNations => tanksDirectoryNations;
public byte[] TankBigIcon(string tankId, string pdaName)
{ {
return provider.Files.Keys.ToArray(); return [];
} }
} }