update mixer

This commit is contained in:
tresabhi committed 2026-08-04 20:34:11 -05:00
1 parent 36e8a20cd5
commit 6a05f11001
4 files changed
+26 -28

No files matched your search

@@ -2,7 +2,7 @@ import { useThree, type ThreeEvent } from "@react-three/fiber";
import type { QuicklimeEvent } from "quicklime"; import type { QuicklimeEvent } from "quicklime";
import { useCallback, useEffect, useRef } from "react"; import { useCallback, useEffect, useRef } from "react";
import { Group, Vector2 } from "three"; import { Group, Vector2 } from "three";
import { awaitableModelDefinitions } from "../../../core/awaitables/modelDefinitions"; import { api } from "../../../core/blitzkit/api";
import { jsxTree } from "../../../core/blitzkit/jsxTree"; import { jsxTree } from "../../../core/blitzkit/jsxTree";
import { import {
modelTransformEvent, modelTransformEvent,
@@ -12,7 +12,7 @@ import { controlsEnabledEvent } from "../../../core/controlsEnabled";
import { useModel } from "../../../hooks/useModel"; import { useModel } from "../../../hooks/useModel";
import { Mixer } from "../../../stores/mixer"; import { Mixer } from "../../../stores/mixer";
const modelDefinitions = await awaitableModelDefinitions; const modelDefinitions = await api.modelDefinitions();
export function Model() { export function Model() {
const canvas = useThree((state) => state.gl.domElement); const canvas = useThree((state) => state.gl.domElement);
@@ -1,8 +1,8 @@
import { awaitableModelDefinitions } from "../awaitables/modelDefinitions"; import { api } from "./api";
import { awaitableTankDefinitions } from "../awaitables/tankDefinitions";
const tankDefinitions = await api.tankDefinitions();
const modelDefinitions = await api.modelDefinitions();
const tankDefinitions = await awaitableTankDefinitions;
const modelDefinitions = await awaitableModelDefinitions;
const tanks = Object.values(tankDefinitions.tanks).filter((tank) => { const tanks = Object.values(tankDefinitions.tanks).filter((tank) => {
const tankModel = modelDefinitions.models[tank.id]; const tankModel = modelDefinitions.models[tank.id];
const turret = tank.turrets.at(-1)!; const turret = tank.turrets.at(-1)!;
@@ -1,5 +1,4 @@
import { import {
asset,
GunDefinition, GunDefinition,
TankDefinition, TankDefinition,
TIER_ROMAN_NUMERALS, TIER_ROMAN_NUMERALS,
@@ -19,27 +18,26 @@ import {
type ButtonProps, type ButtonProps,
} from "@radix-ui/themes"; } from "@radix-ui/themes";
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import { MixerScene } from "../../../components/MixerScene"; import { MixerScene } from "../../../../components/MixerScene";
import { ModuleButton } from "../../../components/ModuleButtons/ModuleButton"; import { ModuleButton } from "../../../../components/ModuleButtons/ModuleButton";
import { PageWrapper } from "../../../components/PageWrapper"; import { PageWrapper } from "../../../../components/PageWrapper";
import { ScreenshotButton } from "../../../components/ScreenshotButton"; import { ScreenshotButton } from "../../../../components/ScreenshotButton";
import { TankSearch } from "../../../components/TankSearch"; import { TankSearch } from "../../../../components/TankSearch";
import { awaitableModelDefinitions } from "../../../core/awaitables/modelDefinitions"; import { api } from "../../../../core/blitzkit/api";
import { awaitableTankDefinitions } from "../../../core/awaitables/tankDefinitions"; import { curateMixer } from "../../../../core/blitzkit/curateMixer";
import { curateMixer } from "../../../core/blitzkit/curateMixer";
import { import {
LocaleProvider, LocaleProvider,
useLocale, useLocale,
type LocaleAcceptorProps, type LocaleAcceptorProps,
} from "../../../hooks/useLocale"; } from "../../../../hooks/useLocale";
import { Mixer } from "../../../stores/mixer"; import { Mixer } from "../../../../stores/mixer";
import { Tankopedia } from "../../../stores/tankopedia"; import { Tankopedia } from "../../../../stores/tankopedia";
import type { MaybeSkeletonComponentProps } from "../../../types/maybeSkeletonComponentProps"; import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
const modelDefinition = await awaitableModelDefinitions.then( const modelDefinition = await api
({ models }) => models[1] .modelDefinitions()
); .then(({ models }) => models[1]);
const tankDefinitions = await awaitableTankDefinitions; const tankDefinitions = await api.tankDefinitions();
export function Page({ export function Page({
locale, locale,
@@ -65,7 +63,7 @@ type ModuleButtonProps = Omit<ButtonProps, "onSelect"> &
onSelect: ( onSelect: (
tank: TankDefinition, tank: TankDefinition,
turret?: TurretDefinition, turret?: TurretDefinition,
gun?: GunDefinition gun?: GunDefinition,
) => void; ) => void;
turret?: number; turret?: number;
gun?: number; gun?: number;
@@ -112,7 +110,7 @@ function ModuleChooser({
height: "4em", height: "4em",
objectFit: "contain", objectFit: "contain",
}} }}
src={asset(`icons/tanks/big/${tank}.webp`)} src={`/api/tanks/${tank}/icons/big.webp`}
/> />
)} )}
</Button> </Button>
@@ -1,7 +1,7 @@
--- ---
import ToolOpenGraph from "../../../components/ToolOpenGraph.astro"; import ToolOpenGraph from "../../../../components/ToolOpenGraph.astro";
import { tools } from "../../../constants/tools"; import { tools } from "../../../../constants/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro"; import BaseLayout from "../../../../layouts/BaseLayout.astro";
import { Page } from "./_index"; import { Page } from "./_index";
export { getStaticPaths } from "../index.astro"; export { getStaticPaths } from "../index.astro";