PR: refactor name

This commit is contained in:
math-pixel
2026-05-12 13:42:23 +02:00
parent 2c3f0db65b
commit eab552a09b
3 changed files with 9 additions and 28 deletions
@@ -3,21 +3,17 @@ import { useGameStore } from "@/managers/stores/useGameStore";
import { Debug } from "@/utils/debug/Debug"; import { Debug } from "@/utils/debug/Debug";
import type { Vector3Tuple } from "@/types/three/three"; import type { Vector3Tuple } from "@/types/three/three";
interface VillageoisHelperObjectProps { interface NPCHelperProps {
position: Vector3Tuple; position: Vector3Tuple;
} }
export function VillageoisHelperObject({ export function NPCHelper({ position }: NPCHelperProps): React.JSX.Element {
position,
}: VillageoisHelperObjectProps): React.JSX.Element {
const step = useGameStore((state) => state.missionFlow.step); const step = useGameStore((state) => state.missionFlow.step);
const setStep = useGameStore((state) => state.setFlowStep); const setStep = useGameStore((state) => state.setFlowStep);
const debug = Debug.getInstance(); const debug = Debug.getInstance();
const handlePress = (): void => { const handlePress = (): void => {
console.log("[VillageoisHelper] handlePress called, current step:", step);
if (step === "searching") { if (step === "searching") {
console.log("[VillageoisHelper] Transitioning to helped");
setStep("helped"); setStep("helped");
} }
}; };
@@ -28,13 +24,6 @@ export function VillageoisHelperObject({
return <></>; return <></>;
} }
console.log(
"[VillageoisHelper] Rendering, step:",
step,
"position:",
position,
);
return ( return (
<InteractableObject <InteractableObject
kind="trigger" kind="trigger"
@@ -3,13 +3,13 @@ import { useGameStore } from "@/managers/stores/useGameStore";
import { Debug } from "@/utils/debug/Debug"; import { Debug } from "@/utils/debug/Debug";
import type { Vector3Tuple } from "@/types/three/three"; import type { Vector3Tuple } from "@/types/three/three";
interface CentralObjectProps { interface PyloneDestroyedProps {
position: Vector3Tuple; position: Vector3Tuple;
} }
export function CentralObject({ export function PyloneDestroyed({
position, position,
}: CentralObjectProps): React.JSX.Element { }: PyloneDestroyedProps): React.JSX.Element {
const step = useGameStore((state) => state.missionFlow.step); const step = useGameStore((state) => state.missionFlow.step);
const setStep = useGameStore((state) => state.setFlowStep); const setStep = useGameStore((state) => state.setFlowStep);
const setCanMove = useGameStore((state) => state.setCanMove); const setCanMove = useGameStore((state) => state.setCanMove);
@@ -17,19 +17,13 @@ export function CentralObject({
const debug = Debug.getInstance(); const debug = Debug.getInstance();
const handlePress = (): void => { const handlePress = (): void => {
console.log("[CentralObject] handlePress called, current step:", step);
if (step === "helped") { if (step === "helped") {
console.log("[CentralObject] Transitioning to manipulation");
setCanMove(false); setCanMove(false);
setStep("manipulation"); setStep("manipulation");
} else if (step === "searching") { } else if (step === "searching") {
console.log("[CentralObject] Showing help message");
showDialog( showDialog(
"Cet objet est trop lourd pour le porter tout seul, trouve de l'aide", "Cet objet est trop lourd pour le porter tout seul, trouve de l'aide",
); );
} else {
console.log("[CentralObject] Step is not helped or searching, skipping");
} }
}; };
@@ -40,8 +34,6 @@ export function CentralObject({
return <></>; return <></>;
} }
console.log("[CentralObject] Rendering, step:", step, "position:", position);
return ( return (
<InteractableObject <InteractableObject
kind="trigger" kind="trigger"
+4 -4
View File
@@ -16,8 +16,8 @@ import {
import { DebugCameraControls } from "@/components/debug/scene/DebugCameraControls"; import { DebugCameraControls } from "@/components/debug/scene/DebugCameraControls";
import { DebugHelpers } from "@/components/debug/scene/DebugHelpers"; import { DebugHelpers } from "@/components/debug/scene/DebugHelpers";
import { HandTrackingGlove } from "@/components/three/handTracking/HandTrackingGlove"; import { HandTrackingGlove } from "@/components/three/handTracking/HandTrackingGlove";
import { CentralObject } from "@/components/three/interaction/CentralObject"; import { PyloneDestroyed } from "@/components/three/interaction/PyloneDestroyed";
import { VillageoisHelperObject } from "@/components/three/interaction/VillageoisHelperObject"; import { NPCHelper } from "@/components/three/interaction/NPCHelper";
import { Environment } from "@/world/Environment"; import { Environment } from "@/world/Environment";
import { GameCinematics } from "@/world/GameCinematics"; import { GameCinematics } from "@/world/GameCinematics";
import { GameDialogues } from "@/world/GameDialogues"; import { GameDialogues } from "@/world/GameDialogues";
@@ -75,8 +75,8 @@ export function World({ onLoadingStateChange }: WorldProps): React.JSX.Element {
<GameFlow /> <GameFlow />
<ZoneDetection /> <ZoneDetection />
<ZoneDebugVisuals /> <ZoneDebugVisuals />
<VillageoisHelperObject position={[1, 12, -55]} /> <NPCHelper position={[1, 12, -55]} />
<CentralObject position={[1, 15, -45]} /> <PyloneDestroyed position={[1, 15, -45]} />
{noMusic ? null : <GameMusic />} {noMusic ? null : <GameMusic />}
{noCinematics ? null : <GameCinematics />} {noCinematics ? null : <GameCinematics />}
{noDialogues ? null : <GameDialogues />} {noDialogues ? null : <GameDialogues />}