From 90fba52a92c9b0a04c57113aeee6927e3b18bc48 Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 12 Jul 2026 20:56:45 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9sum=C3=A9=20de=20partie=20:=20d=C3=A9tai?= =?UTF-8?q?l=20des=20manches=20+=20ic=C3=B4nes=20de=20cat=C3=A9gories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GameOver : nouvelle section "Détail des manches" (tableau manches × joueurs avec ligne Total) pour les parties multi-manches ; indicateurs Cabo/Kamikaze - ScoringCategory : champs icon (lucide) + color pour un visuel par catégorie - Harmonies : icônes + couleurs de terrain (arbres, montagnes, champs, bâtiments, rivière, animaux, esprits) affichées dans PlayGame et GameOver Co-Authored-By: Claude Opus 4.8 --- src/games/harmonie/config.ts | 14 +++--- src/pages/GameOver.tsx | 95 +++++++++++++++++++++++++++++++++++- src/pages/PlayGame.tsx | 32 +++++++++--- src/types/index.ts | 2 + 4 files changed, 129 insertions(+), 14 deletions(-) diff --git a/src/games/harmonie/config.ts b/src/games/harmonie/config.ts index be6e2cc..ba9e506 100644 --- a/src/games/harmonie/config.ts +++ b/src/games/harmonie/config.ts @@ -1,17 +1,19 @@ import { GameConfig, ScoringCategory } from "../../types"; const BASE_CATEGORIES: ScoringCategory[] = [ - { id: "arbres", label: "Arbres" }, - { id: "montagnes", label: "Montagnes" }, - { id: "champs", label: "Champs" }, - { id: "batiments", label: "Bâtiments" }, - { id: "eau", label: "Rivière" }, - { id: "animaux", label: "Animaux" }, + { id: "arbres", label: "Arbres", icon: "TreePine", color: "#16a34a" }, + { id: "montagnes", label: "Montagnes", icon: "Mountain", color: "#64748b" }, + { id: "champs", label: "Champs", icon: "Wheat", color: "#d97706" }, + { id: "batiments", label: "Bâtiments", icon: "Building2", color: "#dc2626" }, + { id: "eau", label: "Rivière", icon: "Waves", color: "#0ea5e9" }, + { id: "animaux", label: "Animaux", icon: "Rabbit", color: "#a16207" }, ]; const NATURE_SPIRIT_CATEGORY: ScoringCategory = { id: "esprits_nature", label: "Esprits de la nature", + icon: "Sparkles", + color: "#8b5cf6", }; export const harmonieConfig: GameConfig = { diff --git a/src/pages/GameOver.tsx b/src/pages/GameOver.tsx index c657bf5..51a184a 100644 --- a/src/pages/GameOver.tsx +++ b/src/pages/GameOver.tsx @@ -137,7 +137,7 @@ export default function GameOver() { const topWinner = totals.find((t) => t.isWinner)?.player; return ( -
+
{/* 💥 Animation de Célébration (disparaît après qq secondes) */} {showCelebration && topWinner && ( @@ -242,11 +242,21 @@ export default function GameOver() { {categories.map((cat) => { const val = t.details?.[cat.id]; if (!val || val === "0") return null; + const CatIcon = cat.icon + ? (Icons as any)[cat.icon] + : null; return (
+ {CatIcon && ( + + )} {cat.label} @@ -262,6 +272,89 @@ export default function GameOver() { ))}
+ + {/* Round-by-round detail (multi-round games) */} + {session.rounds.length > 1 && ( +
+

+ Détail des manches +

+ + + + + + + {session.players.map((p) => ( + + ))} + + + + {session.rounds.map((round) => ( + + + {session.players.map((p) => { + const s = round.scores.find( + (sc) => sc.playerId === p.id, + ); + return ( + + ); + })} + + ))} + + + {session.players.map((p) => ( + + ))} + + +
+ Manche + + {p.name} +
+ #{round.roundNumber} + + {s ? s.score : "—"} + {s?.caboCall === "success" && ( + + ✓ + + )} + {s?.caboCall === "fail" && ( + + ✗ + + )} + {s?.kamikaze && ( + + K + + )} +
+ Total + + {calculateTotalScore(p.id)} +
+
+
+
+ )}
diff --git a/src/pages/PlayGame.tsx b/src/pages/PlayGame.tsx index c7cb224..d0bcb5a 100644 --- a/src/pages/PlayGame.tsx +++ b/src/pages/PlayGame.tsx @@ -322,13 +322,31 @@ export default function PlayGame() { {/* Current Round Input Section */}
-

- {categories - ? categories[currentCategoryIndex].label - : isSingleRound - ? "Saisie des scores" - : "À vos marques !"} -

+
+ {categories && + (() => { + const cat = categories[currentCategoryIndex]; + const CatIcon = cat.icon ? (Icons as any)[cat.icon] : null; + return CatIcon ? ( + + + + ) : null; + })()} +

+ {categories + ? categories[currentCategoryIndex].label + : isSingleRound + ? "Saisie des scores" + : "À vos marques !"} +

+
{categories && currentCategoryIndex > 0 && (