/** * React Component for displaying all of the player's installed Augmentations and * Source-Files. * * It also contains 'configuration' buttons that allow you to change how the * Augs/SF's are displayed */ import { Box, ListItemButton, Paper, Typography } from "@mui/material"; import Button from "@mui/material/Button"; import List from "@mui/material/List"; import Tooltip from "@mui/material/Tooltip"; import React, { useState } from "react"; import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums"; import { Settings } from "../../Settings/Settings"; import { use } from "../../ui/Context"; import { Augmentations } from "../Augmentations"; import { AugmentationNames } from "../data/AugmentationNames"; export function InstalledAugmentations(): React.ReactElement { const setRerender = useState(true)[1]; const player = use.Player(); const sourceAugs = player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor); const [selectedAug, setSelectedAug] = useState(sourceAugs[0]); if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) { sourceAugs.sort((aug1, aug2) => { return aug1.name.localeCompare(aug2.name); }); } function rerender(): void { setRerender((old) => !old); } function sortByAcquirementTime(): void { Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime; rerender(); } function sortInOrder(): void { Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically; rerender(); } return ( Installed Augmentations {sourceAugs.length > 0 ? ( {sourceAugs.map((k, i) => ( setSelectedAug(k)} selected={selectedAug === k}> {k.name} ))} {selectedAug.name} {(() => { const aug = Augmentations[selectedAug.name]; const info = typeof aug.info === "string" ? {aug.info} : aug.info; const tooltip = ( <> {info}

{aug.stats} ); return tooltip; })()}
) : ( No Augmentations have been installed yet )}
); }