feat(multi): add game mode selection and surrender button for all_finish mode

This commit is contained in:
jessy-david-dev
2026-04-11 21:58:35 +02:00
parent 552bb17c15
commit 0401cdffe6
13 changed files with 202 additions and 26 deletions
+3 -1
View File
@@ -14,6 +14,7 @@ export default function WikiRush() {
const [joinCode, setJoinCode] = useState("");
const [maxPlayers, setMaxPlayers] = useState(16);
const [totalRounds, setTotalRounds] = useState(3);
const [gameMode, setGameMode] = useState<"race" | "all_finish">("race");
const [error, setError] = useState<string | null>(null);
const [loading, setLoading] = useState(false);
const [showAuth, setShowAuth] = useState(false);
@@ -22,7 +23,7 @@ export default function WikiRush() {
const multi = useMultiGame();
const { session } = useGameEffects({ solo, multi, screen, setScreen, setPlayerName });
const handlers = useGameHandlers({ solo, multi, playerName, joinCode, maxPlayers, totalRounds, setScreen, setError, setLoading });
const handlers = useGameHandlers({ solo, multi, playerName, joinCode, maxPlayers, totalRounds, gameMode, setScreen, setError, setLoading });
return (
<ScreenRouter
@@ -32,6 +33,7 @@ export default function WikiRush() {
joinCode={joinCode} setJoinCode={setJoinCode}
maxPlayers={maxPlayers} setMaxPlayers={setMaxPlayers}
totalRounds={totalRounds} setTotalRounds={setTotalRounds}
gameMode={gameMode} setGameMode={setGameMode}
error={error} setError={setError} loading={loading}
showAuth={showAuth} setShowAuth={setShowAuth}
/>