UI: Show BitNode multipliers in BN 5.1 (#1398)

This commit is contained in:
catloversg 2024-06-16 06:35:32 +07:00 committed by GitHub
parent f6de21ea18
commit ceb58bc6b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

@ -28,9 +28,10 @@ function customFormatPercent(value: number): string {
}
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 || Player.sourceFileLvl(5) === 0)
// If the player doesn't have access to SF5 feature or if the property isn't affected by BitNode mults
if (props.mult === 1 || (Player.bitNodeN !== 5 && Player.sourceFileLvl(5) === 0)) {
return <Typography color={props.color}>{customFormatPercent(props.base)}</Typography>;
}
return (
<Typography color={props.color}>

@ -229,8 +229,6 @@ export function CharacterStats(): React.ReactElement {
}
timeRows.push(["Total", convertTimeMsToTimeElapsedString(Player.totalPlaytime)]);
let showBitNodeMults = false;
if (Player.sourceFileLvl(5) > 0) showBitNodeMults = true;
return (
<Container maxWidth="lg" disableGutters sx={{ mx: 0 }}>
<Typography variant="h4">Stats</Typography>
@ -592,7 +590,7 @@ export function CharacterStats(): React.ReactElement {
<CurrentBitNode />
{showBitNodeMults && (
{(Player.bitNodeN === 5 || Player.sourceFileLvl(5) > 0) && (
<Paper sx={{ p: 1, mb: 1 }}>
<Typography variant="h5">BitNode Multipliers</Typography>
<BitNodeMultipliersDisplay n={Player.bitNodeN} />