this has taken hours

This commit is contained in:
tresabhi committed 2026-06-05 20:53:28 -05:00
1 parent 81e17317be
commit ef7e002e8c
3 files changed
+38 -35

No files matched your search

-29
View File
@@ -4,9 +4,6 @@ on:
push:
workflow_dispatch:
# schedule:
# - cron: "0 4 * * *"
permissions:
contents: read
pages: write
@@ -75,36 +72,10 @@ jobs:
bun run setup
./scripts/setup_depot_downloader.sh
- name: Download fingerprint
run: |
./scripts/download_fingerprint.sh
# - name: Download cached game
# uses: actions/cache@v5
# id: game-cache
# with:
# path: temp/game
# key: ${{ runner.os }}-${{ hashFiles(format('temp/game/{0}', env.FINGERPRINT)) }}
- name: Download Steam game
# if: steps.game-cache.outputs.cache-hit != 'true'
run: scripts/download_game.sh
- name: Build
run: bun run build-website
env:
BUILD_CHUNK: ${{ matrix.chunk }}
# - name: Upload artifact
# id: upload
# uses: actions/upload-pages-artifact@v4
# with:
# path: dist/website
# - name: Trigger target repository
# run: |
# curl -X POST \
# -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://github.com \
# -d '{ "event_type": "deploy-pages", "client_payload": { "artifact_url": "${{ steps.upload.outputs.artifact_url }}" } }'
+38 -5
View File
@@ -15,6 +15,11 @@ using CUE4Parse.UE4.AssetRegistry.Objects;
using CUE4Parse.UE4.Readers;
using CUE4Parse.UE4.AssetRegistry.Readers;
using CUE4Parse.UE4.AssetRegistry;
using CUE4Parse.UE4.Assets.Exports.Engine;
using CUE4Parse.UE4.Assets.Objects;
using CUE4Parse.UE4.Assets.Exports.StaticMesh;
using CUE4Parse_Conversion.Meshes;
using CUE4Parse_Conversion;
namespace BlitzKit.Game.JSExport;
@@ -102,16 +107,44 @@ public partial class GameInterface
}
private readonly string[] tankPartEntries = ["DT_Chassis", "DT_Hulls", "DT_Turrets", "DT_Guns"];
readonly Dictionary<string, string> tankPartPrefixes = new()
{
{"chassis", "DT_Chassis"},
{"hull", "DT_Hulls"},
{"turret", "DT_Turrets"},
{"gun", "DT_Guns"},
};
public byte[] TankPart(string tag, string part)
{
var pda = provider.Discovered<UPrimaryDataAsset>(tag);
UDataTable? dataTable = null;
foreach (var entry in tankPartEntries) {
pda.Get<FSoftObjectPath>(entry);
// var icon = pda.Get<FSoftObjectPath>("Icon");
foreach (var (prefix, name) in tankPartPrefixes)
{
if (!part.StartsWith(prefix)) { continue; }
dataTable = pda.Get<UDataTable>(name);
break;
}
return [];
if (dataTable == null)
{
throw new ArgumentException($"Unknown tank part: {part}");
}
dataTable.TryGetDataTableRow(part, StringComparison.Ordinal, out var row);
if (row == null)
{
throw new ArgumentException($"Unknown tank part: {part}");
}
var visualData = row.Get<UObject>("VisualData");
var meshSettings = visualData.Get<FStructFallback>("MeshSettings");
// var collisionMesh = meshSettings.Get<UStaticMesh>("CollisionMesh");
var mesh = meshSettings.Get<UStaticMesh>("GunMesh");
var gltf = new MonoGltf(mesh);
return [.. gltf.Write()];
}
}
@@ -67,7 +67,6 @@ public partial class BlitzFileProvider : DefaultFileProvider
public T Discovered<T>(string path) where T : UObject
{
Console.WriteLine(discovered[path]);
return LoadPackageObject<T>(discovered[path]);
}