From e76e254c3eda432481118caa73a092813aaf6c14 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:24:57 +0700 Subject: [PATCH] BLADEBURNER: Fix wrong tooltip description in ActionLevel (#1384) --- src/Bladeburner/ui/ActionLevel.tsx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/Bladeburner/ui/ActionLevel.tsx b/src/Bladeburner/ui/ActionLevel.tsx index 9210f565a..59e15620f 100644 --- a/src/Bladeburner/ui/ActionLevel.tsx +++ b/src/Bladeburner/ui/ActionLevel.tsx @@ -7,6 +7,7 @@ import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp"; import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; import { BladeburnerConstants } from "../data/Constants"; +import { Contract } from "../Actions"; interface ActionLevelProps { action: LevelableAction; @@ -18,6 +19,11 @@ interface ActionLevelProps { export function ActionLevel({ action, isActive, bladeburner, rerender }: ActionLevelProps): React.ReactElement { const canIncrease = action.level < action.maxLevel; const canDecrease = action.level > 1; + const successesNeededForNextLevel = action.getSuccessesNeededForNextLevel( + action instanceof Contract + ? BladeburnerConstants.ContractSuccessesPerLevel + : BladeburnerConstants.OperationSuccessesPerLevel, + ); function increaseLevel(): void { if (!canIncrease) return; @@ -36,21 +42,7 @@ export function ActionLevel({ action, isActive, bladeburner, rerender }: ActionL return ( - - {action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed - for next level - - ) : ( - - {action.getSuccessesNeededForNextLevel(BladeburnerConstants.OperationSuccessesPerLevel)} successes - needed for next level - - ) - } - > + {successesNeededForNextLevel} successes needed for next level}> Level: {action.level} / {action.maxLevel}