UI: Change description and add tooltip for HackMoney-related multipliers (#1823)

* UI: Change description and add tooltip for HackMoney-related multipliers

* Update based on feedback
This commit is contained in:
catloversg 2024-12-18 17:51:25 +07:00 committed by GitHub
parent 9c4b0c004c
commit e6078ab1df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 60 additions and 31 deletions

@ -4,7 +4,7 @@
## BitNodeMultipliers.ManualHackMoney property ## BitNodeMultipliers.ManualHackMoney property
Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount.
**Signature:** **Signature:**

@ -51,14 +51,14 @@ interface BitNodeMultipliers
| [HomeComputerRamCost](./bitburner.bitnodemultipliers.homecomputerramcost.md) | | number | Influences how much money it costs to upgrade your home computer's RAM | | [HomeComputerRamCost](./bitburner.bitnodemultipliers.homecomputerramcost.md) | | number | Influences how much money it costs to upgrade your home computer's RAM |
| [InfiltrationMoney](./bitburner.bitnodemultipliers.infiltrationmoney.md) | | number | Influences how much money is gained when the player infiltrates a company. | | [InfiltrationMoney](./bitburner.bitnodemultipliers.infiltrationmoney.md) | | number | Influences how much money is gained when the player infiltrates a company. |
| [InfiltrationRep](./bitburner.bitnodemultipliers.infiltrationrep.md) | | number | Influences how much rep the player can gain from factions when selling stolen documents and secrets | | [InfiltrationRep](./bitburner.bitnodemultipliers.infiltrationrep.md) | | number | Influences how much rep the player can gain from factions when selling stolen documents and secrets |
| [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. | | [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount. |
| [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | | number | Influence how much it costs to purchase a server | | [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | | number | Influence how much it costs to purchase a server |
| [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | | number | Influences the maximum number of purchased servers you can have | | [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | | number | Influences the maximum number of purchased servers you can have |
| [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | | number | Influences the maximum allowed RAM for a purchased server | | [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | | number | Influences the maximum allowed RAM for a purchased server |
| [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | | number | Influence how much it costs to purchase a server | | [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | | number | Influence how much it costs to purchase a server |
| [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. | | [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | | number | Influences how much money can be stolen from a server when a script performs a hack against it. | | [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | | number | Influences how much money is stolen from a server when the player performs a hack against it. |
| [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | | number | The amount of money actually gained when a script hacks a server. This is different than the above because you can reduce the amount of money but not gain that same amount. | | [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | | number | Influences how much money the player actually gains when a script hacks a server. This is different from ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount. |
| [ServerGrowthRate](./bitburner.bitnodemultipliers.servergrowthrate.md) | | number | Influences the growth percentage per cycle against a server. | | [ServerGrowthRate](./bitburner.bitnodemultipliers.servergrowthrate.md) | | number | Influences the growth percentage per cycle against a server. |
| [ServerMaxMoney](./bitburner.bitnodemultipliers.servermaxmoney.md) | | number | Influences the maximum money that a server can grow to. | | [ServerMaxMoney](./bitburner.bitnodemultipliers.servermaxmoney.md) | | number | Influences the maximum money that a server can grow to. |
| [ServerStartingMoney](./bitburner.bitnodemultipliers.serverstartingmoney.md) | | number | Influences the initial money that a server starts with. | | [ServerStartingMoney](./bitburner.bitnodemultipliers.serverstartingmoney.md) | | number | Influences the initial money that a server starts with. |

@ -4,7 +4,7 @@
## BitNodeMultipliers.ScriptHackMoney property ## BitNodeMultipliers.ScriptHackMoney property
Influences how much money can be stolen from a server when a script performs a hack against it. Influences how much money is stolen from a server when the player performs a hack against it.
**Signature:** **Signature:**

@ -4,7 +4,7 @@
## BitNodeMultipliers.ScriptHackMoneyGain property ## BitNodeMultipliers.ScriptHackMoneyGain property
The amount of money actually gained when a script hacks a server. This is different than the above because you can reduce the amount of money but not gain that same amount. Influences how much money the player actually gains when a script hacks a server. This is different from ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount.
**Signature:** **Signature:**

@ -115,8 +115,9 @@ export class BitNodeMultipliers {
InfiltrationRep = 1; InfiltrationRep = 1;
/** /**
* Influences how much money can be stolen from a server when the player performs a hack against it through * Influences how much money the player actually gains when they hack a server via the terminal. This is different
* the Terminal. * from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is
* reduced, but they do not gain that same amount.
*/ */
ManualHackMoney = 1; ManualHackMoney = 1;
@ -135,12 +136,12 @@ export class BitNodeMultipliers {
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */ /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
RepToDonateToFaction = 1; RepToDonateToFaction = 1;
/** Influences how much money can be stolen from a server when a script performs a hack against it. */ /** Influences how much money is stolen from a server when the player performs a hack against it. */
ScriptHackMoney = 1; ScriptHackMoney = 1;
/** /**
* The amount of money actually gained when a script hacks a server. This is * Influences how much money the player actually gains when a script hacks a server. This is different from
* different than the above because you can reduce the amount of money but * ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does
* not gain that same amount. * not gain that same amount.
*/ */
ScriptHackMoneyGain = 1; ScriptHackMoneyGain = 1;

@ -1,6 +1,15 @@
import React from "react"; import React from "react";
import { uniqueId } from "lodash"; import {
import { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from "@mui/material"; Box,
Collapse,
ListItemButton,
ListItemText,
Paper,
Table,
TableBody,
Tooltip,
Typography,
} from "@mui/material";
import ExpandLess from "@mui/icons-material/ExpandLess"; import ExpandLess from "@mui/icons-material/ExpandLess";
import ExpandMore from "@mui/icons-material/ExpandMore"; import ExpandMore from "@mui/icons-material/ExpandMore";
@ -70,6 +79,7 @@ type IBNMultRows = PartialRecord<
name: string; name: string;
content?: string; content?: string;
color?: string; color?: string;
tooltipText?: string;
} }
>; >;
@ -82,14 +92,26 @@ interface IBNMultTableProps {
const BNMultTable = (props: IBNMultTableProps): React.ReactElement => { const BNMultTable = (props: IBNMultTableProps): React.ReactElement => {
const rowsArray = getRecordEntries(props.rowData) const rowsArray = getRecordEntries(props.rowData)
.filter(([key]) => props.mults[key] !== defaultMultipliers[key]) .filter(([key]) => props.mults[key] !== defaultMultipliers[key])
.map(([key, value]) => ( .map(([key, value]) => {
const name = value.tooltipText ? (
<Tooltip title={<span>{value.tooltipText}</span>}>
<span>
{value.name}
<sup>(*)</sup>
</span>
</Tooltip>
) : (
value.name
);
return (
<StatsRow <StatsRow
key={uniqueId()} key={`${props.sectionName}-${value.name}`}
name={value.name} name={name}
data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }} data={{ content: value.content ?? `${(props.mults[key] * 100).toFixed(3)}%` }}
color={value.color ?? Settings.theme.primary} color={value.color ?? Settings.theme.primary}
/> />
)); );
});
return rowsArray.length > 0 ? ( return rowsArray.length > 0 ? (
<span style={{ display: "inline-block", width: "100%", marginBottom: "16px" }}> <span style={{ display: "inline-block", width: "100%", marginBottom: "16px" }}>
@ -241,16 +263,19 @@ function HackingMults({ mults }: IMultsProps): React.ReactElement {
ServerStartingSecurity: { name: "Server Starting Security" }, ServerStartingSecurity: { name: "Server Starting Security" },
ServerWeakenRate: { name: "Server Weaken Rate" }, ServerWeakenRate: { name: "Server Weaken Rate" },
ManualHackMoney: { ManualHackMoney: {
name: "Manual Hack Money", name: "Money Gained From Manual Hack",
color: Settings.theme.money, color: Settings.theme.money,
tooltipText: `Influences how much money the player actually gains when they hack a server via the terminal. This is different from "Stolen Money From Hack". When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount.`,
}, },
ScriptHackMoney: { ScriptHackMoney: {
name: "Script Hack Money", name: "Stolen Money From Hack",
color: Settings.theme.money, color: Settings.theme.money,
tooltipText: "Influences how much money is stolen from a server when the player performs a hack against it.",
}, },
ScriptHackMoneyGain: { ScriptHackMoneyGain: {
name: "Money Gained From Hack", name: "Money Gained From Script Hack",
color: Settings.theme.money, color: Settings.theme.money,
tooltipText: `Influences how much money the player actually gains when a script hacks a server. This is different from "Stolen Money From Hack". When a script hacks a server, the amount of money in that server is reduced, but the player does not gain that same amount.`,
}, },
}; };

@ -728,8 +728,9 @@ interface BitNodeMultipliers {
/** Influences how much rep the player can gain from factions when selling stolen documents and secrets */ /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */
InfiltrationRep: number; InfiltrationRep: number;
/** /**
* Influences how much money can be stolen from a server when the player performs a hack against it through * Influences how much money the player actually gains when they hack a server via the terminal. This is different
* the Terminal. * from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is
* reduced, but they do not gain that same amount.
*/ */
ManualHackMoney: number; ManualHackMoney: number;
/** Influence how much it costs to purchase a server */ /** Influence how much it costs to purchase a server */
@ -742,11 +743,11 @@ interface BitNodeMultipliers {
PurchasedServerMaxRam: number; PurchasedServerMaxRam: number;
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */ /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
RepToDonateToFaction: number; RepToDonateToFaction: number;
/** Influences how much money can be stolen from a server when a script performs a hack against it. */ /** Influences how much money is stolen from a server when the player performs a hack against it. */
ScriptHackMoney: number; ScriptHackMoney: number;
/** /**
* The amount of money actually gained when a script hacks a server. This is * Influences how much money the player actually gains when a script hacks a server. This is different from
* different than the above because you can reduce the amount of money but * ScriptHackMoney. When a script hacks a server, the amount of money in that server is reduced, but the player does
* not gain that same amount. * not gain that same amount.
*/ */
ScriptHackMoneyGain: number; ScriptHackMoneyGain: number;

@ -109,7 +109,9 @@ function CurrentBitNode(): React.ReactElement {
<Typography variant="h5"> <Typography variant="h5">
BitNode {Player.bitNodeN}: {BitNodes[index].name} (Level {lvl}) BitNode {Player.bitNodeN}: {BitNodes[index].name} (Level {lvl})
</Typography> </Typography>
<Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography> <Typography component="div" sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>
{BitNodes[index].info}
</Typography>
</Paper> </Paper>
); );
} }

@ -12,7 +12,7 @@ interface ITableRowData {
} }
interface IProps { interface IProps {
name: string; name: string | React.ReactElement;
color: string; color: string;
data?: ITableRowData; data?: ITableRowData;
children?: React.ReactElement; children?: React.ReactElement;