From a384b8af528fd5a9ad9e4976a96ba894cf761638 Mon Sep 17 00:00:00 2001
From: nickofolas <60761231+nickofolas@users.noreply.github.com>
Date: Wed, 30 Mar 2022 14:29:59 -0400
Subject: [PATCH] Fix grafting crash when all Augs owned
---
.../Grafting/ui/GraftingRoot.tsx | 130 +++++++++---------
1 file changed, 67 insertions(+), 63 deletions(-)
diff --git a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx
index 280af238c..969b9abef 100644
--- a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx
+++ b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx
@@ -64,74 +64,78 @@ export const GraftingRoot = (): React.ReactElement => {
Graft Augmentations
-
-
- {getAvailableAugs(player).map((k, i) => (
- setSelectedAug(k)} selected={selectedAug === k}>
- {k}
-
- ))}
-
-
-
- {selectedAug}
-
-
- setGraftOpen(false)}
- onConfirm={() => {
- const graftableAug = GraftableAugmentations[selectedAug];
- player.loseMoney(graftableAug.cost, "augmentations");
- player.startGraftAugmentationWork(selectedAug, graftableAug.time);
- player.startFocusing();
- router.toWork();
- }}
- confirmationText={
- <>
- Cancelling grafting will not save grafting progress, and the money you spend will not be
- returned.
-
-
- Additionally, grafting an Augmentation will increase the potency of the Entropy virus.
- >
- }
- />
-
- Time to Graft:{" "}
- {convertTimeMsToTimeElapsedString(
- GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3),
- )}
- {/* Use formula so the displayed creation time is accurate to player bonus */}
-
-
- {(() => {
- const aug = Augmentations[selectedAug];
-
- const info = typeof aug.info === "string" ? {aug.info} : aug.info;
- const tooltip = (
+
+ setGraftOpen(false)}
+ onConfirm={() => {
+ const graftableAug = GraftableAugmentations[selectedAug];
+ player.loseMoney(graftableAug.cost, "augmentations");
+ player.startGraftAugmentationWork(selectedAug, graftableAug.time);
+ player.startFocusing();
+ router.toWork();
+ }}
+ confirmationText={
<>
- {info}
+ Cancelling grafting will not save grafting progress, and the money you spend will not{" "}
+ be returned.
- {aug.stats}
+ Additionally, grafting an Augmentation will increase the potency of the Entropy virus.
>
- );
- return tooltip;
- })()}
-
-
-
+ }
+ />
+
+ Time to Graft:{" "}
+ {convertTimeMsToTimeElapsedString(
+ GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3),
+ )}
+ {/* Use formula so the displayed creation time is accurate to player bonus */}
+
+
+ {(() => {
+ const aug = Augmentations[selectedAug];
+
+ const info = typeof aug.info === "string" ? {aug.info} : aug.info;
+ const tooltip = (
+ <>
+ {info}
+
+
+ {aug.stats}
+ >
+ );
+ return tooltip;
+ })()}
+
+
+
+ ) : (
+ All Augmentations owned
+ )}