From e6078ab1dfa3f26f80c8332b4e14852c321a7d12 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:51:25 +0700 Subject: [PATCH] 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 --- ...rner.bitnodemultipliers.manualhackmoney.md | 2 +- markdown/bitburner.bitnodemultipliers.md | 6 +-- ...rner.bitnodemultipliers.scripthackmoney.md | 2 +- ....bitnodemultipliers.scripthackmoneygain.md | 2 +- src/BitNode/BitNodeMultipliers.ts | 11 ++-- .../ui/BitnodeMultipliersDescription.tsx | 51 ++++++++++++++----- src/ScriptEditor/NetscriptDefinitions.d.ts | 11 ++-- src/ui/CharacterStats.tsx | 4 +- src/ui/React/StatsRow.tsx | 2 +- 9 files changed, 60 insertions(+), 31 deletions(-) diff --git a/markdown/bitburner.bitnodemultipliers.manualhackmoney.md b/markdown/bitburner.bitnodemultipliers.manualhackmoney.md index 28270002e..33fd52eb4 100644 --- a/markdown/bitburner.bitnodemultipliers.manualhackmoney.md +++ b/markdown/bitburner.bitnodemultipliers.manualhackmoney.md @@ -4,7 +4,7 @@ ## 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:** diff --git a/markdown/bitburner.bitnodemultipliers.md b/markdown/bitburner.bitnodemultipliers.md index 6a4222cf3..26e5ec822 100644 --- a/markdown/bitburner.bitnodemultipliers.md +++ b/markdown/bitburner.bitnodemultipliers.md @@ -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 | | [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 | -| [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 | | [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 | | [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. | -| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | | number | Influences how much money can be stolen from a server when a script 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. | +| [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 | 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. | | [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. | diff --git a/markdown/bitburner.bitnodemultipliers.scripthackmoney.md b/markdown/bitburner.bitnodemultipliers.scripthackmoney.md index 900905b2a..40616c14c 100644 --- a/markdown/bitburner.bitnodemultipliers.scripthackmoney.md +++ b/markdown/bitburner.bitnodemultipliers.scripthackmoney.md @@ -4,7 +4,7 @@ ## 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:** diff --git a/markdown/bitburner.bitnodemultipliers.scripthackmoneygain.md b/markdown/bitburner.bitnodemultipliers.scripthackmoneygain.md index b07df74cd..8012a0d89 100644 --- a/markdown/bitburner.bitnodemultipliers.scripthackmoneygain.md +++ b/markdown/bitburner.bitnodemultipliers.scripthackmoneygain.md @@ -4,7 +4,7 @@ ## 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:** diff --git a/src/BitNode/BitNodeMultipliers.ts b/src/BitNode/BitNodeMultipliers.ts index 86609db23..f132e9f55 100644 --- a/src/BitNode/BitNodeMultipliers.ts +++ b/src/BitNode/BitNodeMultipliers.ts @@ -115,8 +115,9 @@ export class BitNodeMultipliers { InfiltrationRep = 1; /** - * 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. */ 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. */ 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; /** - * 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 + * 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. */ ScriptHackMoneyGain = 1; diff --git a/src/BitNode/ui/BitnodeMultipliersDescription.tsx b/src/BitNode/ui/BitnodeMultipliersDescription.tsx index f89baee55..3acac5ad8 100644 --- a/src/BitNode/ui/BitnodeMultipliersDescription.tsx +++ b/src/BitNode/ui/BitnodeMultipliersDescription.tsx @@ -1,6 +1,15 @@ import React from "react"; -import { uniqueId } from "lodash"; -import { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from "@mui/material"; +import { + Box, + Collapse, + ListItemButton, + ListItemText, + Paper, + Table, + TableBody, + Tooltip, + Typography, +} from "@mui/material"; import ExpandLess from "@mui/icons-material/ExpandLess"; import ExpandMore from "@mui/icons-material/ExpandMore"; @@ -70,6 +79,7 @@ type IBNMultRows = PartialRecord< name: string; content?: string; color?: string; + tooltipText?: string; } >; @@ -82,14 +92,26 @@ interface IBNMultTableProps { const BNMultTable = (props: IBNMultTableProps): React.ReactElement => { const rowsArray = getRecordEntries(props.rowData) .filter(([key]) => props.mults[key] !== defaultMultipliers[key]) - .map(([key, value]) => ( - - )); + .map(([key, value]) => { + const name = value.tooltipText ? ( + {value.tooltipText}}> + + {value.name} + (*) + + + ) : ( + value.name + ); + return ( + + ); + }); return rowsArray.length > 0 ? ( @@ -241,16 +263,19 @@ function HackingMults({ mults }: IMultsProps): React.ReactElement { ServerStartingSecurity: { name: "Server Starting Security" }, ServerWeakenRate: { name: "Server Weaken Rate" }, ManualHackMoney: { - name: "Manual Hack Money", + name: "Money Gained From Manual Hack", 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: { - name: "Script Hack Money", + name: "Stolen Money From Hack", color: Settings.theme.money, + tooltipText: "Influences how much money is stolen from a server when the player performs a hack against it.", }, ScriptHackMoneyGain: { - name: "Money Gained From Hack", + name: "Money Gained From Script Hack", 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.`, }, }; diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 29d370a4d..7022ce604 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -728,8 +728,9 @@ interface BitNodeMultipliers { /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */ InfiltrationRep: number; /** - * 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. */ ManualHackMoney: number; /** Influence how much it costs to purchase a server */ @@ -742,11 +743,11 @@ interface BitNodeMultipliers { PurchasedServerMaxRam: number; /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */ 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; /** - * 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 + * 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. */ ScriptHackMoneyGain: number; diff --git a/src/ui/CharacterStats.tsx b/src/ui/CharacterStats.tsx index 090700089..9d7eac192 100644 --- a/src/ui/CharacterStats.tsx +++ b/src/ui/CharacterStats.tsx @@ -109,7 +109,9 @@ function CurrentBitNode(): React.ReactElement { BitNode {Player.bitNodeN}: {BitNodes[index].name} (Level {lvl}) - {BitNodes[index].info} + + {BitNodes[index].info} + ); } diff --git a/src/ui/React/StatsRow.tsx b/src/ui/React/StatsRow.tsx index 219d5f596..238576d6b 100644 --- a/src/ui/React/StatsRow.tsx +++ b/src/ui/React/StatsRow.tsx @@ -12,7 +12,7 @@ interface ITableRowData { } interface IProps { - name: string; + name: string | React.ReactElement; color: string; data?: ITableRowData; children?: React.ReactElement;