chore(format): apply prettier formatting
This commit is contained in:
+161
-646
File diff suppressed because it is too large
Load Diff
@@ -151,7 +151,7 @@ export function EbikeSpeedmeter({
|
|||||||
// Default centre: horizontal middle + needle-pivot height.
|
// Default centre: horizontal middle + needle-pivot height.
|
||||||
// gaugeOffsetX/Y shift the pivot so the arc aligns with cadran.png.
|
// gaugeOffsetX/Y shift the pivot so the arc aligns with cadran.png.
|
||||||
const cx = size * (0.5 + gaugeOffsetX);
|
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 outerR = size * gaugeOuterR;
|
||||||
const innerR = size * gaugeInnerR;
|
const innerR = size * gaugeInnerR;
|
||||||
@@ -212,11 +212,12 @@ export function EbikeSpeedmeter({
|
|||||||
</mesh>
|
</mesh>
|
||||||
|
|
||||||
{/* Needle — pivot at bottom-centre of the arc */}
|
{/* Needle — pivot at bottom-centre of the arc */}
|
||||||
<group ref={needleGroupRef} position={[0, -height * 0.38, 0.002]} rotation={[0, 0, 0]}>
|
<group
|
||||||
<mesh
|
ref={needleGroupRef}
|
||||||
position={[0, needleHeight / 2, 0]}
|
position={[0, -height * 0.38, 0.002]}
|
||||||
renderOrder={renderOrder + 1}
|
rotation={[0, 0, 0]}
|
||||||
>
|
>
|
||||||
|
<mesh position={[0, needleHeight / 2, 0]} renderOrder={renderOrder + 1}>
|
||||||
<planeGeometry args={[needleWidth, needleHeight]} />
|
<planeGeometry args={[needleWidth, needleHeight]} />
|
||||||
<meshBasicMaterial
|
<meshBasicMaterial
|
||||||
map={needleTexture}
|
map={needleTexture}
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ export function PylonDownedPylon(): React.JSX.Element | null {
|
|||||||
if (!group) return;
|
if (!group) return;
|
||||||
|
|
||||||
if (!isStraightening || straightenStartRef.current === null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +119,10 @@ export function PylonDownedPylon(): React.JSX.Element | null {
|
|||||||
void (async () => {
|
void (async () => {
|
||||||
const m = await loadDialogueManifest();
|
const m = await loadDialogueManifest();
|
||||||
if (!m) return;
|
if (!m) return;
|
||||||
await playDialogueById(m, PYLON_NARRATIVE_DIALOGUES.demandeAide);
|
await playDialogueById(
|
||||||
|
m,
|
||||||
|
PYLON_NARRATIVE_DIALOGUES.demandeAide,
|
||||||
|
);
|
||||||
})();
|
})();
|
||||||
},
|
},
|
||||||
{ once: true },
|
{ once: true },
|
||||||
@@ -127,7 +132,10 @@ export function PylonDownedPylon(): React.JSX.Element | null {
|
|||||||
void (async () => {
|
void (async () => {
|
||||||
const manifest = await loadDialogueManifest();
|
const manifest = await loadDialogueManifest();
|
||||||
if (!manifest) return;
|
if (!manifest) return;
|
||||||
await playDialogueById(manifest, PYLON_NARRATIVE_DIALOGUES.demandeAide);
|
await playDialogueById(
|
||||||
|
manifest,
|
||||||
|
PYLON_NARRATIVE_DIALOGUES.demandeAide,
|
||||||
|
);
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
} else if (step === "npc-return" && !isStraightening) {
|
} 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 step = useGameStore((state) => state.pylon.currentStep);
|
||||||
const setMissionStep = useGameStore((state) => state.setMissionStep);
|
const setMissionStep = useGameStore((state) => state.setMissionStep);
|
||||||
const groupRef = useRef<THREE.Group>(null);
|
const groupRef = useRef<THREE.Group>(null);
|
||||||
const currentPosRef = useRef(
|
const currentPosRef = useRef(new THREE.Vector3(...PYLON_FARMER_NPC_POSITION));
|
||||||
new THREE.Vector3(...PYLON_FARMER_NPC_POSITION),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Reset position when entering arrived, set target when entering npc-return
|
// Reset position when entering arrived, set target when entering npc-return
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -44,7 +42,10 @@ export function PylonFarmerNPC(): React.JSX.Element | null {
|
|||||||
? PYLON_FARMER_NPC_AFTER_POSITION_pylone_straight
|
? PYLON_FARMER_NPC_AFTER_POSITION_pylone_straight
|
||||||
: PYLON_FARMER_NPC_AFTER_POSITION;
|
: PYLON_FARMER_NPC_AFTER_POSITION;
|
||||||
_target.set(...targetPos);
|
_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.position.copy(currentPosRef.current);
|
||||||
group.rotation.set(...PYLON_FARMER_NPC_AFTER_ROTATION);
|
group.rotation.set(...PYLON_FARMER_NPC_AFTER_ROTATION);
|
||||||
group.scale.setScalar(PYLON_FARMER_NPC_AFTER_SCALE);
|
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 (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 (
|
return (
|
||||||
<group ref={groupRef} position={PYLON_FARMER_NPC_POSITION}>
|
<group ref={groupRef} position={PYLON_FARMER_NPC_POSITION}>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export const PYLON_APPROACH_ZONE: ZoneConfig = {
|
|||||||
id: "pylon-approach",
|
id: "pylon-approach",
|
||||||
position: [
|
position: [
|
||||||
PYLON_WORLD_POSITION[0],
|
PYLON_WORLD_POSITION[0],
|
||||||
PYLON_WORLD_POSITION[1]- 5,
|
PYLON_WORLD_POSITION[1] - 5,
|
||||||
PYLON_WORLD_POSITION[2],
|
PYLON_WORLD_POSITION[2],
|
||||||
],
|
],
|
||||||
radius: 5,
|
radius: 5,
|
||||||
|
|||||||
Reference in New Issue
Block a user