feat(repair): inject ebike + pylon parts at packderelance anchors
- Ebike replacement parts: cooling core (correct, anchored at refroidisseur) + four distractors anchored at cabledroit/cablegauche/pucehaut/pucebas. Removes the ad-hoc gant_l/talkie distractors in favor of consistent case-anchored visuals. - Pylon replacement parts: cable1 + cable2 (alternative correct, both with caseLockGroup 'pylon-cable' for upcoming soft-lock) + refroidisseur and two puce distractors anchored to packderelance. - Farm replacement parts kept as-is (caseAnchor undefined falls back to placeholder slot positions for backward compatibility). - RepairGame threads anchors from RepairCaseModel through RepairMissionCase to RepairRepairingStep; replacement-part initial position now resolves to the anchor world position when caseAnchor is set, falling back to the legacy slot index otherwise.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { Suspense, useEffect, useMemo, useState } from "react";
|
||||
import { useGLTF } from "@react-three/drei";
|
||||
import { ExplodableModel } from "@/components/three/models/ExplodableModel";
|
||||
import type { RepairCasePlaceholder } from "@/components/three/gameplay/RepairCaseModel";
|
||||
import type {
|
||||
RepairCasePartAnchors,
|
||||
RepairCasePlaceholder,
|
||||
} from "@/components/three/gameplay/RepairCaseModel";
|
||||
import { RepairCompletionStep } from "@/components/three/gameplay/RepairCompletionStep";
|
||||
import { RepairInspectionObject } from "@/components/three/gameplay/RepairInspectionObject";
|
||||
import { RepairMissionCase } from "@/components/three/gameplay/RepairMissionCase";
|
||||
@@ -63,6 +66,7 @@ export function RepairGame({
|
||||
const [casePlaceholders, setCasePlaceholders] = useState<
|
||||
readonly RepairCasePlaceholder[]
|
||||
>([]);
|
||||
const [caseAnchors, setCaseAnchors] = useState<RepairCasePartAnchors>({});
|
||||
const [scannedBrokenParts, setScannedBrokenParts] = useState<
|
||||
readonly RepairScannedBrokenPart[]
|
||||
>([]);
|
||||
@@ -81,6 +85,7 @@ export function RepairGame({
|
||||
|
||||
const timeoutId = window.setTimeout(() => {
|
||||
setCasePlaceholders([]);
|
||||
setCaseAnchors({});
|
||||
setScannedBrokenParts([]);
|
||||
}, 0);
|
||||
|
||||
@@ -137,6 +142,7 @@ export function RepairGame({
|
||||
) : null}
|
||||
{step === "repairing" ? (
|
||||
<RepairRepairingStep
|
||||
anchors={caseAnchors}
|
||||
brokenParts={scannedBrokenParts}
|
||||
config={config}
|
||||
placeholders={casePlaceholders}
|
||||
@@ -159,6 +165,7 @@ export function RepairGame({
|
||||
<RepairMissionCase
|
||||
config={config}
|
||||
onPlaceholdersChange={setCasePlaceholders}
|
||||
onAnchorsChange={setCaseAnchors}
|
||||
open={step === "repairing"}
|
||||
zoomed={step === "repairing"}
|
||||
showFragmentationPrompt={readyForFragmentation}
|
||||
|
||||
Reference in New Issue
Block a user