diff --git a/src/context/LauncherContext.tsx b/src/context/LauncherContext.tsx index e09fdc3..db83551 100644 --- a/src/context/LauncherContext.tsx +++ b/src/context/LauncherContext.tsx @@ -14,6 +14,7 @@ import { useSkinSync } from "../hooks/useSkinSync"; import { useDiscordRPC } from "../hooks/useDiscordRPC"; import { useGamepad } from "../hooks/useGamepad"; import { useUpdateCheck } from "../hooks/useUpdateCheck"; +import { SPLASHES } from "../data/splashes"; import RpcService from "../services/RpcService"; interface UIContextType { @@ -175,7 +176,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) { useEffect(() => { if (activeView === "main") { - audioRaw.setSplashIndex(-1); + audioRaw.setSplashIndex(Math.floor(Math.random() * SPLASHES.length)); } }, [activeView]); diff --git a/src/hooks/useAudioController.ts b/src/hooks/useAudioController.ts index 687ae6f..14cb900 100644 --- a/src/hooks/useAudioController.ts +++ b/src/hooks/useAudioController.ts @@ -30,7 +30,9 @@ export function useAudioController({ isWindowVisible, }: AudioControllerProps) { const [currentTrack, setCurrentTrack] = useState(0); - const [splashIndex, setSplashIndex] = useState(-1); + const [splashIndex, setSplashIndex] = useState( + () => Math.floor(Math.random() * SPLASHES.length), + ); const audioContextRef = useRef(null); const musicSourceRef = useRef(null); const musicGainRef = useRef(null);