mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 04:47:03 +02:00
UI: Change how hacking level requirement is shown in "Create program" tab (#1900)
* UI: Change how hacking level requirement is shown in "Create program" tab * Remove "s" from "Unlocks at hacking levels" --------- Co-authored-by: David Walker <d0sboots@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { find } from "lodash";
|
import { find } from "lodash";
|
||||||
import { Box, Typography, Button, Container, Paper } from "@mui/material";
|
import { Box, Typography, Button, Container, Paper, Tooltip } from "@mui/material";
|
||||||
import { Check, Lock, Create } from "@mui/icons-material";
|
import { Check, Lock, Create } from "@mui/icons-material";
|
||||||
|
|
||||||
import { Player } from "@player";
|
import { Player } from "@player";
|
||||||
@@ -72,6 +72,7 @@ export function ProgramsRoot(): React.ReactElement {
|
|||||||
const create = program.create;
|
const create = program.create;
|
||||||
if (create === null) return <></>;
|
if (create === null) return <></>;
|
||||||
const curCompletion = getProgCompletion(program.name);
|
const curCompletion = getProgCompletion(program.name);
|
||||||
|
const hackingLevelRemaining = getHackingLevelRemaining(create.level);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -116,10 +117,12 @@ export function ProgramsRoot(): React.ReactElement {
|
|||||||
Create program
|
Create program
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
{Player.hasProgram(program.name) || getHackingLevelRemaining(create.level) === 0 || (
|
{Player.hasProgram(program.name) || hackingLevelRemaining === 0 || (
|
||||||
<Typography color={Settings.theme.hack}>
|
<Tooltip title={<>Unlocks after you gain {hackingLevelRemaining} more hacking levels</>}>
|
||||||
<b>Unlocks in:</b> {getHackingLevelRemaining(create.level)} hacking levels
|
<Typography color={Settings.theme.hack}>
|
||||||
</Typography>
|
<b>Unlocks at hacking level:</b> {Player.skills.hacking + hackingLevelRemaining}
|
||||||
|
</Typography>
|
||||||
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{curCompletion !== -1 && (
|
{curCompletion !== -1 && (
|
||||||
<Typography color={Settings.theme.infolight}>
|
<Typography color={Settings.theme.infolight}>
|
||||||
|
|||||||
Reference in New Issue
Block a user