mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
beginnings of equipment icon
This commit is contained in:
1 parent
17264c1adc
commit
ca270e2010
6 files changed
+47
-13
No files matched your search
+2
-1
@@ -5,7 +5,8 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"setup": "chmod a+x scripts/*.sh && ./scripts/setup.sh",
|
||||
"dev": "./scripts/dev.sh"
|
||||
"dev": "./scripts/dev.sh",
|
||||
"build-game": "./scripts/build_game.sh"
|
||||
},
|
||||
"type": "module",
|
||||
"workspaces": [
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text.RegularExpressions;
|
||||
using BlitzKit.Game.Models;
|
||||
using CUE4Parse_Conversion.Textures;
|
||||
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||
using CUE4Parse.UE4.Objects.Engine;
|
||||
using CUE4Parse.UE4.Objects.UObject;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.JavaScript.NodeApi;
|
||||
using SkiaSharp;
|
||||
|
||||
@@ -15,12 +15,12 @@ public partial class GameInterface
|
||||
{
|
||||
private readonly BlitzFileProvider provider;
|
||||
|
||||
public string[] files;
|
||||
public HashSet<string> files;
|
||||
public string[] tanksDirectoryNations;
|
||||
|
||||
public GameInterface(string directory)
|
||||
public GameInterface(string directory, string map)
|
||||
{
|
||||
provider = new(directory);
|
||||
provider = new(directory, map);
|
||||
|
||||
files = [.. provider.Files.Keys];
|
||||
|
||||
@@ -36,7 +36,7 @@ public partial class GameInterface
|
||||
];
|
||||
}
|
||||
|
||||
public string[] Files => files;
|
||||
public HashSet<string> Files => files;
|
||||
public string[] TanksDirectoryNations => tanksDirectoryNations;
|
||||
|
||||
public byte[] TankBigIcon(string tankId, string pdaName)
|
||||
@@ -111,4 +111,35 @@ public partial class GameInterface
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
private static readonly string equipmentPDAPrefix =
|
||||
"Blitz/Content/TanksStuff/Equipment/PDA_Equipment";
|
||||
private static readonly string equipmentPDASuffix = ".uasset";
|
||||
|
||||
public byte[] EquipmentIcon(string[] names)
|
||||
{
|
||||
List<string> candidates = [];
|
||||
|
||||
foreach (var name in names)
|
||||
{
|
||||
candidates.AddRange([
|
||||
$"{equipmentPDAPrefix}{name}{equipmentPDASuffix}",
|
||||
$"{equipmentPDAPrefix}_{name}{equipmentPDASuffix}",
|
||||
]);
|
||||
}
|
||||
|
||||
foreach (var candidate in candidates)
|
||||
{
|
||||
if (!files.Contains(candidate))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Console.WriteLine(candidate);
|
||||
}
|
||||
|
||||
// TODO: warn if no equipment icons found
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace BlitzKit.Game.Models;
|
||||
|
||||
public class BlitzFileProvider : DefaultFileProvider
|
||||
{
|
||||
public BlitzFileProvider(string directory)
|
||||
public BlitzFileProvider(string directory, string map)
|
||||
: base(
|
||||
directory: directory,
|
||||
searchOption: SearchOption.AllDirectories,
|
||||
@@ -16,12 +16,12 @@ public class BlitzFileProvider : DefaultFileProvider
|
||||
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||
)
|
||||
{
|
||||
MappingsContainer = new FileUsmapTypeMappingsProvider("../../packages/closed/blitz.usmap");
|
||||
MappingsContainer = new FileUsmapTypeMappingsProvider(map);
|
||||
|
||||
Initialize();
|
||||
Mount();
|
||||
|
||||
// OodleHelper.DownloadOodleDll($"../../temp/oodle.so");
|
||||
OodleHelper.Initialize($"../../temp/oodle.so");
|
||||
// OodleHelper.Initialize($"../../temp/oodle.so");
|
||||
}
|
||||
}
|
||||
@@ -58,9 +58,10 @@ function Consumables() {
|
||||
const isCompatible = useCompatibility(tank);
|
||||
|
||||
return Object.values(consumables.consumables).map(
|
||||
({ compatibility, consumable }) => {
|
||||
({ compatibility, consumable, purchase }) => {
|
||||
if (!isCompatible(compatibility!)) return null;
|
||||
return <span>{consumable!.name_key}</span>;
|
||||
|
||||
return <span>{JSON.stringify(consumable, null, 2)}</span>;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
cd packages/game
|
||||
dotnet build --no-restore
|
||||
@@ -3,7 +3,6 @@ bun install
|
||||
cd packages/scripts
|
||||
bun run build:protos
|
||||
bun run build:proxyclient
|
||||
bun run build:proxyclient
|
||||
bun run build:catalogitemaccessor
|
||||
|
||||
cd ../game
|
||||
|
||||
Reference in new issue
Block a user