diff --git a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/CharacterCard.tsx b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/CharacterCard.tsx index 8a772d64..bb8ac21c 100644 --- a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/CharacterCard.tsx +++ b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/CharacterCard.tsx @@ -32,9 +32,12 @@ export function CharacterCard(props: CharacterCardProps) { const showNewExpansions = useNewCustomContentPage(); const stats = useStore((store) => store.rules.stats); + const conditionMeters = useStore((store) => store.rules.conditionMeters); const trackLabel = useGameSystemValue({ - [GAME_SYSTEMS.IRONSWORN]: "XP and Bonds", + [GAME_SYSTEMS.IRONSWORN]: showNewExpansions + ? "XP and Legacy Tracks" + : "XP and Bonds", [GAME_SYSTEMS.STARFORGED]: "Legacy Tracks", }); const TrackComponent = useGameSystemValue< @@ -155,42 +158,64 @@ export function CharacterCard(props: CharacterCardProps) { )} - - + {showNewExpansions ? ( + <> + {Object.keys(conditionMeters) + .filter((cm) => !conditionMeters[cm].shared) + .map((cm) => ( + + ))} + + ) : ( + <> + + + {customTracks.map((customTrack) => { + const index = customTrackValues[customTrack.label]; + const value = + index !== undefined && + typeof customTrack.values[index].value === "number" + ? (customTrack.values[index].value as number) + : 0; + + return ( + + ); + })} + + )} + - {customTracks.map((customTrack) => { - const index = customTrackValues[customTrack.label]; - const value = - index !== undefined && - typeof customTrack.values[index].value === "number" - ? (customTrack.values[index].value as number) - : 0; - - return ( - - ); - })} }> @@ -216,23 +241,6 @@ export function CharacterCard(props: CharacterCardProps) { - - {/* - }> - Notes - - - {character.shareNotesWithGM ? ( - - ) : ( - - {user?.displayName ?? "User"} has not opted-in to sharing their - character notes with you. They can change this under the - character tab on their character sheet. - - )} - - */} ); diff --git a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/IronswornTracks.tsx b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/IronswornTracks.tsx index f75dc8fe..ac187c1f 100644 --- a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/IronswornTracks.tsx +++ b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/IronswornTracks.tsx @@ -2,8 +2,9 @@ import SpentIcon from "@mui/icons-material/RadioButtonChecked"; import EarnedIcon from "@mui/icons-material/HighlightOff"; import EmptyIcon from "@mui/icons-material/RadioButtonUnchecked"; import { useStore } from "stores/store"; -import { Box, Typography } from "@mui/material"; +import { Box, Stack, Typography } from "@mui/material"; import { ProgressTrack } from "components/features/ProgressTrack"; +import { useNewCustomContentPage } from "hooks/featureFlags/useNewCustomContentPage"; const totalExp = 30; export interface IronswornTracksProps { @@ -12,6 +13,15 @@ export interface IronswornTracksProps { export function IronswornTracks(props: IronswornTracksProps) { const { characterId } = props; + + const showNewExpansions = useNewCustomContentPage(); + const specialTracks = useStore((store) => store.rules.specialTracks); + const specialTrackValues = useStore( + (store) => + store.campaigns.currentCampaign.characters.characterMap[characterId] + .specialTracks ?? {} + ); + const xp = useStore( (store) => store.campaigns.currentCampaign.characters.characterMap[characterId] @@ -44,10 +54,30 @@ export function IronswornTracks(props: IronswornTracksProps) { ))} - theme.fontFamilyTitle} sx={{ mt: 2 }}> - Bonds - - + {showNewExpansions ? ( + + {Object.keys(specialTracks) + .filter((specialTrack) => !specialTracks[specialTrack].shared) + .map((specialTrack) => ( + + ))} + + ) : ( + <> + theme.fontFamilyTitle} + sx={{ mt: 2 }} + > + Bonds + + + + )} ); } diff --git a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/LegacyTracks.tsx b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/LegacyTracks.tsx index 4d6fe137..e52c03d3 100644 --- a/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/LegacyTracks.tsx +++ b/src/pages/Campaign/CampaignGMScreenPage/components/CharacterCard/LegacyTracks.tsx @@ -1,4 +1,5 @@ import { Stack } from "@mui/material"; +import { useNewCustomContentPage } from "hooks/featureFlags/useNewCustomContentPage"; import { LegacyTrack } from "pages/Character/CharacterSheetPage/Tabs/TracksSection/LegacyTrack"; import { useStore } from "stores/store"; @@ -15,26 +16,54 @@ export function LegacyTracks(props: LegacyTracksProps) { .legacyTracks ?? {} ); + const showNewExpansions = useNewCustomContentPage(); + const specialTracks = useStore((store) => store.rules.specialTracks); + const specialTrackValues = useStore( + (store) => + store.campaigns.currentCampaign.characters.characterMap[characterId] + .specialTracks ?? {} + ); + return ( - - - + {showNewExpansions ? ( + <> + {Object.keys(specialTracks) + .filter((st) => !specialTracks[st].shared) + .map((st) => ( + + ))} + + ) : ( + <> + + + + + )} ); } diff --git a/src/pages/Campaign/CampaignGMScreenPage/components/TracksSection.tsx b/src/pages/Campaign/CampaignGMScreenPage/components/TracksSection.tsx index 9d842c7b..d35d62df 100644 --- a/src/pages/Campaign/CampaignGMScreenPage/components/TracksSection.tsx +++ b/src/pages/Campaign/CampaignGMScreenPage/components/TracksSection.tsx @@ -1,4 +1,4 @@ -import { Stack } from "@mui/material"; +import { Grid, Stack } from "@mui/material"; import { SectionHeading } from "components/shared/SectionHeading"; import { supplyTrack } from "data/defaultTracks"; import { Track } from "components/features/Track"; @@ -8,6 +8,7 @@ import { useStore } from "stores/store"; import { ClockSection } from "components/features/charactersAndCampaigns/Clocks/ClockSection"; import { useGameSystem } from "hooks/useGameSystem"; import { GAME_SYSTEMS } from "types/GameSystems.type"; +import { useNewCustomContentPage } from "hooks/featureFlags/useNewCustomContentPage"; export interface TracksSectionProps { supply: number; @@ -21,6 +22,15 @@ export function TracksSection(props: TracksSectionProps) { (store) => store.campaigns.currentCampaign.updateCampaignSupply ); + const conditionMeterRules = useStore((store) => store.rules.conditionMeters); + const conditionMeterValues = useStore( + (store) => store.campaigns.currentCampaign.currentCampaign?.conditionMeters + ); + const showNewConditionMeters = useNewCustomContentPage(); + const updateCampaignConditionMeter = useStore( + (store) => store.campaigns.currentCampaign.updateCampaignConditionMeter + ); + const tracks = useStore( (store) => store.campaigns.currentCampaign.tracks.trackMap ); @@ -48,19 +58,49 @@ export function TracksSection(props: TracksSectionProps) { return ( - - updateCampaignSupply(newValue).catch(() => {})} - /> + {showNewConditionMeters ? ( + <> + + + {Object.keys(conditionMeterRules) + .filter((cm) => conditionMeterRules[cm].shared) + .map((cm) => ( + + + updateCampaignConditionMeter(cm, newValue).catch(() => {}) + } + /> + + ))} + + + ) : ( + <> + + + updateCampaignSupply(newValue).catch(() => {}) + } + /> + + )}