fix: show dialogue subtitles on black screen
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (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
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (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
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
import { Subtitles } from "@/components/ui/Subtitles";
|
||||||
import { useGameStore } from "@/managers/stores/useGameStore";
|
import { useGameStore } from "@/managers/stores/useGameStore";
|
||||||
import { SITE_DIALOGUE_IDS } from "@/data/site/dialogueIds";
|
import { SITE_DIALOGUE_IDS } from "@/data/site/dialogueIds";
|
||||||
import { loadDialogueManifest } from "@/utils/dialogues/loadDialogueManifest";
|
import { loadDialogueManifest } from "@/utils/dialogues/loadDialogueManifest";
|
||||||
@@ -63,21 +64,9 @@ export function IntroDialogueOverlay(): React.JSX.Element {
|
|||||||
inset: 0,
|
inset: 0,
|
||||||
background: "#000",
|
background: "#000",
|
||||||
zIndex: 999,
|
zIndex: 999,
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<Subtitles />
|
||||||
aria-hidden="true"
|
|
||||||
style={{
|
|
||||||
color: "rgba(255, 255, 255, 0.5)",
|
|
||||||
fontSize: 16,
|
|
||||||
fontFamily: "system-ui, sans-serif",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
...
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ const REVEAL_DURATION_MS = 2000;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fade-out overlay revealing the game world.
|
* Fade-out overlay revealing the game world.
|
||||||
* Calls completeIntro() when the fade is done — completeIntro also flips
|
* Calls completeIntro() when the fade is done — completeIntro also marks
|
||||||
* intro.currentStep to "playing" so no separate setIntroStep call is needed.
|
* intro.currentStep as "completed" so no separate setIntroStep call is needed.
|
||||||
*/
|
*/
|
||||||
export function IntroRevealOverlay(): React.JSX.Element {
|
export function IntroRevealOverlay(): React.JSX.Element {
|
||||||
const completeIntro = useGameStore((state) => state.completeIntro);
|
const completeIntro = useGameStore((state) => state.completeIntro);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const GAME_STEPS: readonly GameStep[] = [
|
|||||||
"video",
|
"video",
|
||||||
"dialogue-intro",
|
"dialogue-intro",
|
||||||
"reveal",
|
"reveal",
|
||||||
"playing",
|
"completed",
|
||||||
];
|
];
|
||||||
|
|
||||||
export const MAIN_GAME_STATES: readonly MainGameState[] = [
|
export const MAIN_GAME_STATES: readonly MainGameState[] = [
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function completeIntroState(state: GameState): GameStateUpdate {
|
|||||||
mainState: "ebike",
|
mainState: "ebike",
|
||||||
intro: {
|
intro: {
|
||||||
...state.intro,
|
...state.intro,
|
||||||
currentStep: "playing",
|
currentStep: "completed",
|
||||||
hasCompleted: true,
|
hasCompleted: true,
|
||||||
isEbikeUnlocked: true,
|
isEbikeUnlocked: true,
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -19,6 +19,6 @@ export type GameStep =
|
|||||||
| "video" // Vidéo intro.mp4
|
| "video" // Vidéo intro.mp4
|
||||||
| "dialogue-intro" // Dialogues post-vidéo (écran noir)
|
| "dialogue-intro" // Dialogues post-vidéo (écran noir)
|
||||||
| "reveal" // Fondu noir → jeu visible
|
| "reveal" // Fondu noir → jeu visible
|
||||||
| "playing"; // Intro terminée, jeu actif
|
| "completed"; // Intro terminée
|
||||||
|
|
||||||
export type MainGameState = "intro" | RepairMissionId | "outro";
|
export type MainGameState = "intro" | RepairMissionId | "outro";
|
||||||
|
|||||||
Reference in New Issue
Block a user