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 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,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"