chore(format): apply prettier formatting

This commit is contained in:
Tom Boullay
2026-06-02 22:15:25 +02:00
parent 6a0215d1a6
commit 0f211cc169
5 changed files with 189 additions and 663 deletions
+8 -7
View File
@@ -151,7 +151,7 @@ export function EbikeSpeedmeter({
// Default centre: horizontal middle + needle-pivot height.
// gaugeOffsetX/Y shift the pivot so the arc aligns with cadran.png.
const cx = size * (0.5 + gaugeOffsetX);
const cy = size * ((1 - NEEDLE_PIVOT_UV_Y) + gaugeOffsetY); // default ≈ 0.88 × size
const cy = size * (1 - NEEDLE_PIVOT_UV_Y + gaugeOffsetY); // default ≈ 0.88 × size
const outerR = size * gaugeOuterR;
const innerR = size * gaugeInnerR;
@@ -164,7 +164,7 @@ export function EbikeSpeedmeter({
// Radial gradient using #3F67DD — slightly transparent at inner edge,
// fully solid at outer edge for a depth effect.
const radial = ctx.createRadialGradient(cx, cy, innerR, cx, cy, outerR);
radial.addColorStop(0, "rgba(191, 234, 255, 0)"); // inner edge
radial.addColorStop(0, "rgba(191, 234, 255, 0)"); // inner edge
radial.addColorStop(0.7, "rgba(118, 152, 255, 0.95)"); // outer edge
// Annular sector shape (outer arc + inner arc reversed)
@@ -212,11 +212,12 @@ export function EbikeSpeedmeter({
</mesh>
{/* Needle — pivot at bottom-centre of the arc */}
<group ref={needleGroupRef} position={[0, -height * 0.38, 0.002]} rotation={[0, 0, 0]}>
<mesh
position={[0, needleHeight / 2, 0]}
renderOrder={renderOrder + 1}
>
<group
ref={needleGroupRef}
position={[0, -height * 0.38, 0.002]}
rotation={[0, 0, 0]}
>
<mesh position={[0, needleHeight / 2, 0]} renderOrder={renderOrder + 1}>
<planeGeometry args={[needleWidth, needleHeight]} />
<meshBasicMaterial
map={needleTexture}
@@ -39,7 +39,9 @@ export function PylonDownedPylon(): React.JSX.Element | null {
if (!group) return;
if (!isStraightening || straightenStartRef.current === null) {
group.rotation.set(...(showUpright ? PYLON_UPRIGHT_ROTATION : PYLON_DOWNED_ROTATION));
group.rotation.set(
...(showUpright ? PYLON_UPRIGHT_ROTATION : PYLON_DOWNED_ROTATION),
);
return;
}
@@ -117,7 +119,10 @@ export function PylonDownedPylon(): React.JSX.Element | null {
void (async () => {
const m = await loadDialogueManifest();
if (!m) return;
await playDialogueById(m, PYLON_NARRATIVE_DIALOGUES.demandeAide);
await playDialogueById(
m,
PYLON_NARRATIVE_DIALOGUES.demandeAide,
);
})();
},
{ once: true },
@@ -127,7 +132,10 @@ export function PylonDownedPylon(): React.JSX.Element | null {
void (async () => {
const manifest = await loadDialogueManifest();
if (!manifest) return;
await playDialogueById(manifest, PYLON_NARRATIVE_DIALOGUES.demandeAide);
await playDialogueById(
manifest,
PYLON_NARRATIVE_DIALOGUES.demandeAide,
);
})();
}
} else if (step === "npc-return" && !isStraightening) {
@@ -24,9 +24,7 @@ export function PylonFarmerNPC(): React.JSX.Element | null {
const step = useGameStore((state) => state.pylon.currentStep);
const setMissionStep = useGameStore((state) => state.setMissionStep);
const groupRef = useRef<THREE.Group>(null);
const currentPosRef = useRef(
new THREE.Vector3(...PYLON_FARMER_NPC_POSITION),
);
const currentPosRef = useRef(new THREE.Vector3(...PYLON_FARMER_NPC_POSITION));
// Reset position when entering arrived, set target when entering npc-return
useEffect(() => {
@@ -44,7 +42,10 @@ export function PylonFarmerNPC(): React.JSX.Element | null {
? PYLON_FARMER_NPC_AFTER_POSITION_pylone_straight
: PYLON_FARMER_NPC_AFTER_POSITION;
_target.set(...targetPos);
currentPosRef.current.lerp(_target, Math.min(PYLON_FARMER_NPC_WALK_SPEED * delta, 1));
currentPosRef.current.lerp(
_target,
Math.min(PYLON_FARMER_NPC_WALK_SPEED * delta, 1),
);
group.position.copy(currentPosRef.current);
group.rotation.set(...PYLON_FARMER_NPC_AFTER_ROTATION);
group.scale.setScalar(PYLON_FARMER_NPC_AFTER_SCALE);
@@ -58,7 +59,8 @@ export function PylonFarmerNPC(): React.JSX.Element | null {
});
if (mainState !== "pylon") return null;
if (step !== "arrived" && step !== "npc-return" && step !== "inspected") return null;
if (step !== "arrived" && step !== "npc-return" && step !== "inspected")
return null;
return (
<group ref={groupRef} position={PYLON_FARMER_NPC_POSITION}>