diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index 45784f1..5da349d 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -1239,6 +1239,10 @@ const makeKeywordsBold = (text) => { ); } } + + // replace words wrapped in ^^ ^^ with tags + newValue = newValue.replace(/\^\^([^\^]+)\^\^/g, "$1"); + // replace two newlines with one but only if there are two newlines in a row return newValue.replace(/\n\n+/g, "\n\n"); }; diff --git a/src/10th/ShortSummaryTable.jsx b/src/10th/ShortSummaryTable.jsx index 951372c..1b6f043 100644 --- a/src/10th/ShortSummaryTable.jsx +++ b/src/10th/ShortSummaryTable.jsx @@ -21,7 +21,7 @@ ChartJS.register( ); export const ShortSummaryTable = ({ force, primaryColor, name, points }) => { - const [hide, setHide] = useState(true); + const [hide, setHide] = useState(false); const { units, factionRules, rules, catalog } = force; const sortedUnits = units.sort((a, b) => { @@ -158,7 +158,7 @@ export const ShortSummaryTable = ({ force, primaryColor, name, points }) => { fontWeight: 600, }} > - Wounds + W
{
{sortedUnits.map((unit, index) => { - const { name, cost, models } = unit; - const count = + const { + name, + cost, + models, + modelStats, + abilities, + rangedWeapons, + meleeWeapons, + } = unit; + let count = models?.filter((model) => model.count > 0)?.length === 1 ? models?.[0]?.count || 1 : 1; + if (modelStats?.length === 1) { + // sum of all counts of the models + count = + models?.reduce((sum, model) => sum + model.count, 0) || 1; + } return (
- {count > 1 ? `${count}x ` : ""} - {name} +
+ {count > 1 ? `${count}x ` : ""} + {name} + {abilities?.Abilities?.keys()?.some( + (key) => key === "Leader", + ) && ( + + [Leader] + + )} +
{unit.modelStats?.reduce((sum, stat, index) => { @@ -284,7 +314,7 @@ export const ShortSummaryTable = ({ force, primaryColor, name, points }) => { })}
- Total + {sortedUnits.length} Units
{/* Sum of all wound values */}