mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: tanksDirectoryNations
This commit is contained in:
1 parent
7a817cbe8c
commit
ff02f06cbc
5 files changed
+40
-17
No files matched your search
@@ -0,0 +1,3 @@
|
||||
[*.cs]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -4,7 +4,6 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<NodeApiAssemblyJSModuleType>esm</NodeApiAssemblyJSModuleType>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -7,22 +7,41 @@ namespace game.src.classes;
|
||||
[JSExport]
|
||||
public class BlitzProvider
|
||||
{
|
||||
private readonly DefaultFileProvider provider;
|
||||
private readonly DefaultFileProvider provider;
|
||||
|
||||
public BlitzProvider(string directory)
|
||||
{
|
||||
provider = new(
|
||||
directory: directory,
|
||||
searchOption: SearchOption.AllDirectories,
|
||||
versions: new(EGame.GAME_UE5_5),
|
||||
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||
);
|
||||
provider.Initialize();
|
||||
provider.Mount();
|
||||
}
|
||||
public string[] files;
|
||||
public string[] tanksDirectoryNations;
|
||||
|
||||
public string[] Files()
|
||||
{
|
||||
return provider.Files.Keys.ToArray();
|
||||
}
|
||||
public BlitzProvider(string directory)
|
||||
{
|
||||
provider = new(
|
||||
directory: directory,
|
||||
searchOption: SearchOption.AllDirectories,
|
||||
versions: new(EGame.GAME_UE5_5),
|
||||
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||
);
|
||||
provider.Initialize();
|
||||
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 => files;
|
||||
public string[] TanksDirectoryNations => tanksDirectoryNations;
|
||||
|
||||
public byte[] TankBigIcon(string tankId, string pdaName)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user