migrate compare and tankopedia loadout to new data-driven components, splitting the old monolithic loadout and compare UI into smaller pieces and adding shared Table, Dialog and Scroller primitives

This commit is contained in:
tresabhi committed 2026-11-14 01:17:38 -06:00
1 parent 287aba853f
commit c311a6ab8b
111 files changed
+4009 -3917

No files matched your search

@@ -1,27 +1,18 @@
import { useEffect } from "react";
import { degToRad } from "three/src/math/MathUtils.js";
import { api } from "../api/dynamic";
import { applyPitchYawLimits } from "../core/blitz/applyPitchYawLimits";
import { modelTransformEvent } from "../core/blitzkit/modelTransform";
import { DuelModule, useDuel } from "../hooks/useDuel";
const modelDefinitions = await api.models();
import { useDuelModels } from "../hooks/useDuelModels";
export function InitialCameraAligner() {
const tank = useDuel("protagonist", DuelModule.Tank);
const turret = useDuel("protagonist", DuelModule.Turret);
const gun = useDuel("protagonist", DuelModule.Gun);
const tankModel = modelDefinitions.models[tank.id];
const turretModel = tankModel.turrets[turret.id];
const gunModel = turretModel.guns[gun.id];
const { turret, gun } = useDuelModels("protagonist");
useEffect(() => {
const [pitch, yaw] = applyPitchYawLimits(
degToRad(8),
degToRad(25),
gunModel.pitch!,
turretModel.yaw,
gun.pitch!,
turret.yaw,
);
modelTransformEvent.dispatch({ pitch, yaw });