diff --git a/src/Augmentation/ui/PlayerMultipliers.tsx b/src/Augmentation/ui/PlayerMultipliers.tsx index 01b146040..b5ec5edd7 100644 --- a/src/Augmentation/ui/PlayerMultipliers.tsx +++ b/src/Augmentation/ui/PlayerMultipliers.tsx @@ -34,6 +34,7 @@ interface IBitNodeModifiedStatsProps { } function BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement { + // If player doesn't have SF5 or if the property isn't affected by BitNode mults if (props.mult === 1 || SourceFileFlags[5] === 0) return {numeralWrapper.formatPercentage(props.base)}; @@ -55,33 +56,28 @@ type MultiplierListItemData = [ interface IMultiplierListProps { rows: MultiplierListItemData[]; - noMargin?: boolean; } -function MultiplierList({ rows, noMargin = false }: IMultiplierListProps): React.ReactElement { - const listItems = rows +function MultiplierList(props: IMultiplierListProps): React.ReactElement { + const listItems = props.rows .map((data) => { - const mult = data[0], - value = data[1], - improved = data[2], - bnMult = data[3], - color = data[4]; + const [multiplier, currentValue, augmentedValue, bitNodeMultiplier, color] = data; - if (improved) { + if (!isNaN(augmentedValue)) { return ( - + - {mult} + {multiplier} } secondary={ - + - + } disableTypography @@ -93,19 +89,14 @@ function MultiplierList({ rows, noMargin = false }: IMultiplierListProps): React }) .filter((i) => i !== undefined); - if (listItems.length > 0) { - return ( - - {listItems} - - ); - } - return <>; + return listItems.length > 0 ? {listItems} : <>; } export function PlayerMultipliers(): React.ReactElement { const mults = calculateAugmentedStats(); + // Column data is a bit janky, so it's set up here to allow for + // easier logic in setting up the layout const leftColData: MultiplierListItemData[] = [ ...[ ["Hacking Chance ", Player.hacking_chance_mult, Player.hacking_chance_mult * mults.hacking_chance_mult, 1],