fix : audio and data issues
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled

This commit is contained in:
math-pixel
2026-05-12 14:29:38 +02:00
parent 490f9627cc
commit 700c088c48
2 changed files with 23 additions and 9 deletions
@@ -4,6 +4,20 @@ import {
useGameStore, useGameStore,
} from "@/managers/stores/useGameStore"; } from "@/managers/stores/useGameStore";
import { isMissionStep, MISSION_STEPS } from "@/types/gameplay/repairMission"; import { isMissionStep, MISSION_STEPS } from "@/types/gameplay/repairMission";
import { type GameStep } from "@/types/game";
const GAME_STEPS: GameStep[] = [
"intro",
"start-intro",
"naming",
"bienvenue",
"star-move",
"mission2",
"searching",
"helped",
"manipulation",
"outOfFabrik",
];
const MAIN_STATES: MainGameState[] = [ const MAIN_STATES: MainGameState[] = [
"intro", "intro",
@@ -29,7 +43,7 @@ export function GameStateDebugPanel(): React.JSX.Element {
const detail = useGameStore((state) => { const detail = useGameStore((state) => {
switch (state.mainState) { switch (state.mainState) {
case "intro": case "intro":
return state.intro.hasCompleted ? "completed" : "waiting"; return state.intro.currentStep;
case "bike": case "bike":
return state.bike.currentStep; return state.bike.currentStep;
case "pylone": case "pylone":
@@ -41,7 +55,7 @@ export function GameStateDebugPanel(): React.JSX.Element {
} }
}); });
const setMainState = useGameStore((state) => state.setMainState); const setMainState = useGameStore((state) => state.setMainState);
const setIntroState = useGameStore((state) => state.setIntroState); const setIntroStep = useGameStore((state) => state.setIntroStep);
const setBikeState = useGameStore((state) => state.setBikeState); const setBikeState = useGameStore((state) => state.setBikeState);
const setPyloneState = useGameStore((state) => state.setPyloneState); const setPyloneState = useGameStore((state) => state.setPyloneState);
const setFermeState = useGameStore((state) => state.setFermeState); const setFermeState = useGameStore((state) => state.setFermeState);
@@ -52,14 +66,14 @@ export function GameStateDebugPanel(): React.JSX.Element {
const subStateOptions = const subStateOptions =
mainState === "intro" mainState === "intro"
? ["waiting", "completed"] ? GAME_STEPS
: mainState === "outro" : mainState === "outro"
? ["waiting", "started"] ? ["waiting", "started"]
: MISSION_STEPS; : MISSION_STEPS;
function setSubState(nextSubState: string): void { function setSubState(nextSubState: string): void {
if (mainState === "intro") { if (mainState === "intro") {
setIntroState({ hasCompleted: nextSubState === "completed" }); setIntroStep(nextSubState as GameStep);
return; return;
} }
+5 -5
View File
@@ -1,7 +1,7 @@
export const AUDIO_PATHS = { export const AUDIO_PATHS = {
intro: "/sounds/fa.mp3", intro: "/sounds/effect/fa.mp3",
bienvenue: "/sounds/fa.mp3", bienvenue: "/sounds/effect/fa.mp3",
alertCentral: "/sounds/fa.mp3", alertCentral: "/sounds/effect/fa.mp3",
searching: "/sounds/fa.mp3", searching: "/sounds/effect/fa.mp3",
helped: "/sounds/fa.mp3", helped: "/sounds/effect/fa.mp3",
} as const; } as const;