From 10ba151b6ef0fb98e348bcf12765fdb1d009aa45 Mon Sep 17 00:00:00 2001 From: Aaron Wood Date: Fri, 10 Apr 2026 19:30:51 -0400 Subject: [PATCH] feat: wire AtmospherePanel and ParticleOverlay into CampaignView --- client/src/pages/CampaignView.tsx | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/client/src/pages/CampaignView.tsx b/client/src/pages/CampaignView.tsx index c236d9a..423b4c1 100644 --- a/client/src/pages/CampaignView.tsx +++ b/client/src/pages/CampaignView.tsx @@ -20,6 +20,10 @@ import CharacterDetail from "../components/CharacterDetail"; import RollLog from "../components/RollLog"; import DiceTray from "../components/DiceTray"; import FogOverlay from "../components/FogOverlay"; +import AtmospherePanel from "../components/AtmospherePanel"; +import ParticleOverlay from "../components/ParticleOverlay"; +import type { AtmosphereState } from "../lib/atmosphereTypes"; +import { defaultAtmosphere } from "../lib/atmosphereTypes"; import SelectDropdown from "../components/SelectDropdown"; import styles from "./CampaignView.module.css"; @@ -49,7 +53,12 @@ export default function CampaignView() { id: number; } | null>(null); const pendingRollRef = useRef(null); - const [fogActive, setFogActive] = useState(false); + const [atmosphere, setAtmosphere] = useState(defaultAtmosphere); + + function handleAtmosphereChange(next: AtmosphereState) { + setAtmosphere(next); + socket.emit("atmosphere:update", { campaignId, ...next }); + } // Fetch characters and join socket room useEffect(() => { @@ -242,8 +251,8 @@ export default function CampaignView() { socket.on("talent:added", onTalentAdded); socket.on("talent:removed", onTalentRemoved); socket.on("roll:result", onRollResult); - socket.on("atmosphere:update", (data: { fog: boolean }) => { - setFogActive(data.fog); + socket.on("atmosphere:update", (data: AtmosphereState) => { + setAtmosphere(data); }); return () => { @@ -344,20 +353,10 @@ export default function CampaignView() { {campaignName || "Campaign"}
- +
- + + ); }