PR: refactor name
This commit is contained in:
+2
-13
@@ -3,21 +3,17 @@ import { useGameStore } from "@/managers/stores/useGameStore";
|
||||
import { Debug } from "@/utils/debug/Debug";
|
||||
import type { Vector3Tuple } from "@/types/three/three";
|
||||
|
||||
interface VillageoisHelperObjectProps {
|
||||
interface NPCHelperProps {
|
||||
position: Vector3Tuple;
|
||||
}
|
||||
|
||||
export function VillageoisHelperObject({
|
||||
position,
|
||||
}: VillageoisHelperObjectProps): React.JSX.Element {
|
||||
export function NPCHelper({ position }: NPCHelperProps): React.JSX.Element {
|
||||
const step = useGameStore((state) => state.missionFlow.step);
|
||||
const setStep = useGameStore((state) => state.setFlowStep);
|
||||
const debug = Debug.getInstance();
|
||||
|
||||
const handlePress = (): void => {
|
||||
console.log("[VillageoisHelper] handlePress called, current step:", step);
|
||||
if (step === "searching") {
|
||||
console.log("[VillageoisHelper] Transitioning to helped");
|
||||
setStep("helped");
|
||||
}
|
||||
};
|
||||
@@ -28,13 +24,6 @@ export function VillageoisHelperObject({
|
||||
return <></>;
|
||||
}
|
||||
|
||||
console.log(
|
||||
"[VillageoisHelper] Rendering, step:",
|
||||
step,
|
||||
"position:",
|
||||
position,
|
||||
);
|
||||
|
||||
return (
|
||||
<InteractableObject
|
||||
kind="trigger"
|
||||
+3
-11
@@ -3,13 +3,13 @@ import { useGameStore } from "@/managers/stores/useGameStore";
|
||||
import { Debug } from "@/utils/debug/Debug";
|
||||
import type { Vector3Tuple } from "@/types/three/three";
|
||||
|
||||
interface CentralObjectProps {
|
||||
interface PyloneDestroyedProps {
|
||||
position: Vector3Tuple;
|
||||
}
|
||||
|
||||
export function CentralObject({
|
||||
export function PyloneDestroyed({
|
||||
position,
|
||||
}: CentralObjectProps): React.JSX.Element {
|
||||
}: PyloneDestroyedProps): React.JSX.Element {
|
||||
const step = useGameStore((state) => state.missionFlow.step);
|
||||
const setStep = useGameStore((state) => state.setFlowStep);
|
||||
const setCanMove = useGameStore((state) => state.setCanMove);
|
||||
@@ -17,19 +17,13 @@ export function CentralObject({
|
||||
const debug = Debug.getInstance();
|
||||
|
||||
const handlePress = (): void => {
|
||||
console.log("[CentralObject] handlePress called, current step:", step);
|
||||
|
||||
if (step === "helped") {
|
||||
console.log("[CentralObject] Transitioning to manipulation");
|
||||
setCanMove(false);
|
||||
setStep("manipulation");
|
||||
} else if (step === "searching") {
|
||||
console.log("[CentralObject] Showing help message");
|
||||
showDialog(
|
||||
"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 <></>;
|
||||
}
|
||||
|
||||
console.log("[CentralObject] Rendering, step:", step, "position:", position);
|
||||
|
||||
return (
|
||||
<InteractableObject
|
||||
kind="trigger"
|
||||
+4
-4
@@ -16,8 +16,8 @@ import {
|
||||
import { DebugCameraControls } from "@/components/debug/scene/DebugCameraControls";
|
||||
import { DebugHelpers } from "@/components/debug/scene/DebugHelpers";
|
||||
import { HandTrackingGlove } from "@/components/three/handTracking/HandTrackingGlove";
|
||||
import { CentralObject } from "@/components/three/interaction/CentralObject";
|
||||
import { VillageoisHelperObject } from "@/components/three/interaction/VillageoisHelperObject";
|
||||
import { PyloneDestroyed } from "@/components/three/interaction/PyloneDestroyed";
|
||||
import { NPCHelper } from "@/components/three/interaction/NPCHelper";
|
||||
import { Environment } from "@/world/Environment";
|
||||
import { GameCinematics } from "@/world/GameCinematics";
|
||||
import { GameDialogues } from "@/world/GameDialogues";
|
||||
@@ -75,8 +75,8 @@ export function World({ onLoadingStateChange }: WorldProps): React.JSX.Element {
|
||||
<GameFlow />
|
||||
<ZoneDetection />
|
||||
<ZoneDebugVisuals />
|
||||
<VillageoisHelperObject position={[1, 12, -55]} />
|
||||
<CentralObject position={[1, 15, -45]} />
|
||||
<NPCHelper position={[1, 12, -55]} />
|
||||
<PyloneDestroyed position={[1, 15, -45]} />
|
||||
{noMusic ? null : <GameMusic />}
|
||||
{noCinematics ? null : <GameCinematics />}
|
||||
{noDialogues ? null : <GameDialogues />}
|
||||
|
||||
Reference in New Issue
Block a user