From 988c8305bc08e2bb0e240d6a116067c37597518e Mon Sep 17 00:00:00 2001 From: math-pixel <59537610+math-pixel@users.noreply.github.com> Date: Thu, 14 May 2026 11:58:43 +0200 Subject: [PATCH] update remove naming step --- src/components/game/GameFlow.tsx | 2 +- src/components/ui/IntroUI.tsx | 96 -------------------------------- src/pages/page.tsx | 3 +- src/types/game.ts | 8 +-- 4 files changed, 3 insertions(+), 106 deletions(-) diff --git a/src/components/game/GameFlow.tsx b/src/components/game/GameFlow.tsx index b3595ec..9789c4e 100644 --- a/src/components/game/GameFlow.tsx +++ b/src/components/game/GameFlow.tsx @@ -20,7 +20,7 @@ export function GameFlow(): null { useEffect(() => { if (step === "sequence_video" && !isCinematicPlaying) { - setStep("naming"); + setStep("start-move"); } }, [step, isCinematicPlaying, setStep]); diff --git a/src/components/ui/IntroUI.tsx b/src/components/ui/IntroUI.tsx index 5688aed..02d4053 100644 --- a/src/components/ui/IntroUI.tsx +++ b/src/components/ui/IntroUI.tsx @@ -1,101 +1,5 @@ -import { useState } from "react"; import { useGameStore } from "@/managers/stores/useGameStore"; -export function IntroUI(): React.JSX.Element | null { - const step = useGameStore((state) => state.intro.currentStep); - const setPlayerName = useGameStore((state) => state.setPlayerName); - const setStep = useGameStore((state) => state.setIntroStep); - const [inputValue, setInputValue] = useState(""); - - if (step !== "naming") return null; - - const handleSubmit = (): void => { - if (inputValue.trim() === "") return; - - setPlayerName(inputValue.trim()); - setStep("start-move"); - }; - - const handleKeyDown = (e: React.KeyboardEvent): void => { - if (e.key === "Enter") { - handleSubmit(); - } - }; - - return ( -
-
-

- Quel est votre prenom ? -

- setInputValue(e.target.value)} - onKeyDown={handleKeyDown} - placeholder="Votre prenom" - autoFocus - style={{ - padding: "0.75rem", - fontSize: "1rem", - borderRadius: "6px", - border: "1px solid #444", - backgroundColor: "#2a2a2a", - color: "#fff", - outline: "none", - }} - /> - -
-
- ); -} - export function BienvenueDisplay(): React.JSX.Element | null { const step = useGameStore((state) => state.intro.currentStep); const playerName = useGameStore((state) => state.missionFlow.playerName); diff --git a/src/pages/page.tsx b/src/pages/page.tsx index a08cdbf..e11e782 100644 --- a/src/pages/page.tsx +++ b/src/pages/page.tsx @@ -4,7 +4,7 @@ import * as THREE from "three"; import { DebugPerf } from "@/components/debug/DebugPerf"; import { DialogMessage } from "@/components/ui/DialogMessage"; import { GameUI } from "@/components/ui/GameUI"; -import { BienvenueDisplay, IntroUI } from "@/components/ui/IntroUI"; +import { BienvenueDisplay } from "@/components/ui/IntroUI"; import { SceneLoadingOverlay } from "@/components/ui/SceneLoadingOverlay"; import { useGameStore } from "@/managers/stores/useGameStore"; import { HandTrackingProvider } from "@/providers/gameplay/HandTrackingProvider"; @@ -68,7 +68,6 @@ export function HomePage(): React.JSX.Element { - {dialogMessage ? (