mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +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,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"setup": "chmod a+x scripts/*.sh && ./scripts/setup.sh",
|
"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",
|
"type": "module",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System.IO;
|
using System.Text.RegularExpressions;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using BlitzKit.Game.Models;
|
using BlitzKit.Game.Models;
|
||||||
using CUE4Parse_Conversion.Textures;
|
using CUE4Parse_Conversion.Textures;
|
||||||
using CUE4Parse.UE4.Assets.Exports.Texture;
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
||||||
using CUE4Parse.UE4.Objects.Engine;
|
using CUE4Parse.UE4.Objects.Engine;
|
||||||
using CUE4Parse.UE4.Objects.UObject;
|
using CUE4Parse.UE4.Objects.UObject;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
using Microsoft.JavaScript.NodeApi;
|
using Microsoft.JavaScript.NodeApi;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
@@ -15,12 +15,12 @@ public partial class GameInterface
|
|||||||
{
|
{
|
||||||
private readonly BlitzFileProvider provider;
|
private readonly BlitzFileProvider provider;
|
||||||
|
|
||||||
public string[] files;
|
public HashSet<string> files;
|
||||||
public string[] tanksDirectoryNations;
|
public string[] tanksDirectoryNations;
|
||||||
|
|
||||||
public GameInterface(string directory)
|
public GameInterface(string directory, string map)
|
||||||
{
|
{
|
||||||
provider = new(directory);
|
provider = new(directory, map);
|
||||||
|
|
||||||
files = [.. provider.Files.Keys];
|
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 string[] TanksDirectoryNations => tanksDirectoryNations;
|
||||||
|
|
||||||
public byte[] TankBigIcon(string tankId, string pdaName)
|
public byte[] TankBigIcon(string tankId, string pdaName)
|
||||||
@@ -111,4 +111,35 @@ public partial class GameInterface
|
|||||||
|
|
||||||
return [];
|
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 class BlitzFileProvider : DefaultFileProvider
|
||||||
{
|
{
|
||||||
public BlitzFileProvider(string directory)
|
public BlitzFileProvider(string directory, string map)
|
||||||
: base(
|
: base(
|
||||||
directory: directory,
|
directory: directory,
|
||||||
searchOption: SearchOption.AllDirectories,
|
searchOption: SearchOption.AllDirectories,
|
||||||
@@ -16,12 +16,12 @@ public class BlitzFileProvider : DefaultFileProvider
|
|||||||
pathComparer: StringComparer.OrdinalIgnoreCase
|
pathComparer: StringComparer.OrdinalIgnoreCase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
MappingsContainer = new FileUsmapTypeMappingsProvider("../../packages/closed/blitz.usmap");
|
MappingsContainer = new FileUsmapTypeMappingsProvider(map);
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
Mount();
|
Mount();
|
||||||
|
|
||||||
// OodleHelper.DownloadOodleDll($"../../temp/oodle.so");
|
// 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);
|
const isCompatible = useCompatibility(tank);
|
||||||
|
|
||||||
return Object.values(consumables.consumables).map(
|
return Object.values(consumables.consumables).map(
|
||||||
({ compatibility, consumable }) => {
|
({ compatibility, consumable, purchase }) => {
|
||||||
if (!isCompatible(compatibility!)) return null;
|
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
|
cd packages/scripts
|
||||||
bun run build:protos
|
bun run build:protos
|
||||||
bun run build:proxyclient
|
bun run build:proxyclient
|
||||||
bun run build:proxyclient
|
|
||||||
bun run build:catalogitemaccessor
|
bun run build:catalogitemaccessor
|
||||||
|
|
||||||
cd ../game
|
cd ../game
|
||||||
|
|||||||
Reference in new issue
Block a user