diff --git a/src/app/(frontend)/eod/custom/[id]/page.tsx b/src/app/(frontend)/eod/custom/[id]/page.tsx index a15caa7..b1dfba6 100644 --- a/src/app/(frontend)/eod/custom/[id]/page.tsx +++ b/src/app/(frontend)/eod/custom/[id]/page.tsx @@ -41,6 +41,11 @@ export default async function CustomMinefieldPlayPage({ const mines = Array.isArray(minefield.mines) ? (minefield.mines as { row: number; col: number }[]) : []; + const authorId = + typeof minefield.author === "object" && minefield.author !== null + ? minefield.author.id + : minefield.author; + const isAuthor = user !== null && String(authorId) === String(user.id); return (
- Custom minefields are unranked and do not affect official stats or XP. + Custom wins award reduced XP (10% of standard payouts); field authors bank 5% of each + payout.
@@ -69,8 +75,10 @@ export default async function CustomMinefieldPlayPage({ rows: minefield.rows, cols: minefield.cols, mines, + exposeEdgeMines: minefield.exposeEdgeMines ?? true, }} currentUserId={user?.id ?? 0} + isAuthor={isAuthor} /> ); diff --git a/src/components/frontend/eod/CreateMinefieldDialog.tsx b/src/components/frontend/eod/CreateMinefieldDialog.tsx index 33c59c3..e78edd7 100644 --- a/src/components/frontend/eod/CreateMinefieldDialog.tsx +++ b/src/components/frontend/eod/CreateMinefieldDialog.tsx @@ -4,6 +4,7 @@ import { useState } from "react"; import { Bomb, Loader2 } from "lucide-react"; import { useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; +import { Checkbox } from "@/components/ui/checkbox"; import { Dialog, DialogContent, @@ -34,6 +35,7 @@ export function CreateMinefieldDialog({ const [rows, setRows] = useState(9); const [cols, setCols] = useState(9); const [mines, setMines] = useState+ Failed runs show mines that touch the swept area. Turn off to reveal none of the + remaining charges. +
+{error}
} diff --git a/src/components/frontend/eod/CustomMinefieldArena.tsx b/src/components/frontend/eod/CustomMinefieldArena.tsx index 65c2ad7..c711532 100644 --- a/src/components/frontend/eod/CustomMinefieldArena.tsx +++ b/src/components/frontend/eod/CustomMinefieldArena.tsx @@ -3,6 +3,7 @@ import { useCallback, useState } from "react"; import { CustomMinesweeperBoard, type CustomMinefieldData } from "./CustomMinesweeperBoard"; import { CustomMinefieldLeaderboard } from "./CustomMinefieldLeaderboard"; +import { ExposureRuleToggle } from "./ExposureRuleToggle"; import { useRealtimePresence } from "@/hooks/useRealtimePresence"; import { useSidebar } from "@/components/ui/sidebar"; import { useEffect } from "react"; @@ -10,9 +11,11 @@ import { useEffect } from "react"; export function CustomMinefieldArena({ minefield, currentUserId, + isAuthor, }: { minefield: CustomMinefieldData; currentUserId: number | string; + isAuthor: boolean; }) { const [refreshKey, setRefreshKey] = useState(0); const [playing, setPlaying] = useState(false); @@ -33,6 +36,9 @@ export function CustomMinefieldArena({ onGameRecorded={() => setRefreshKey((key) => key + 1)} onPhaseChange={onPhaseChange} /> + {isAuthor && ( +- Community minefields. Playing these does not affect your official stats or XP. + Community minefields. Wins award reduced XP (10% of standard payouts); field authors + bank 5% of each payout.
+ {checked + ? "Failed runs show mines touching the swept area; everything else stays hidden." + : "Failed runs reveal no remaining charges; swept cells turn gray with a question mark."} +
+ {error &&{error}
} +