diff --git a/src/Augmentation/Augmentation.ts b/src/Augmentation/Augmentation.ts index e1597038f..283265fae 100644 --- a/src/Augmentation/Augmentation.ts +++ b/src/Augmentation/Augmentation.ts @@ -9,7 +9,7 @@ import { Factions } from "../Faction/Factions"; import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver"; interface IConstructorParams { - info: string; + info: string | JSX.Element; isSpecial?: boolean; moneyCost: number; name: string; @@ -57,7 +57,7 @@ export class Augmentation { baseRepRequirement = 0; // Description of what this Aug is and what it does - info = ""; + info: string | JSX.Element; // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs) isSpecial = false; diff --git a/src/PersonObjects/Resleeving/ResleevingUI.tsx b/src/PersonObjects/Resleeving/ResleevingUI.tsx index 23b3da192..9dab831a9 100644 --- a/src/PersonObjects/Resleeving/ResleevingUI.tsx +++ b/src/PersonObjects/Resleeving/ResleevingUI.tsx @@ -368,5 +368,10 @@ function updateAugDescription(elems: IResleeveUIElems): void { return; } - elems.augDescription.innerHTML = aug.info; + let innerHTML = aug.info; + if(typeof innerHTML !== 'string') { + innerHTML = renderToStaticMarkup(innerHTML); + } + + elems.augDescription.innerHTML = innerHTML; } diff --git a/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts b/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts index 41604e766..9f0dcf243 100644 --- a/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts +++ b/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts @@ -55,10 +55,15 @@ export function createSleevePurchaseAugsPopup(sleeve: Sleeve, p: IPlayer): void continue; } + let tooltip = aug.info; + if(typeof tooltip !== 'string') { + tooltip = renderToStaticMarkup(tooltip); + } + ownedAugsDiv.appendChild(createElement("div", { class: "gang-owned-upgrade", // Reusing a class from the Gang UI innerText: ownedAug, - tooltip: aug.info, + tooltip: tooltip, })) } popupElems.push(ownedAugsDiv); @@ -83,13 +88,18 @@ export function createSleevePurchaseAugsPopup(sleeve: Sleeve, p: IPlayer): void class: "cmpy-mgmt-upgrade-div", // We'll reuse this CSS class }); + let info = aug.info; + if(typeof info !== 'string') { + info = renderToStaticMarkup(info); + } + div.appendChild(createElement("p", { fontSize: "12px", innerHTML: [ `

${aug.name}


`, `Cost: ${renderToStaticMarkup(Money(aug.startingCost))}

`, - `${aug.info}`, + `${info}`, ].join(" "), padding: "2px", clickListener: () => { diff --git a/src/ui/React/AugmentationAccordion.tsx b/src/ui/React/AugmentationAccordion.tsx index 87ab4ae8f..19eb601f2 100644 --- a/src/ui/React/AugmentationAccordion.tsx +++ b/src/ui/React/AugmentationAccordion.tsx @@ -24,10 +24,19 @@ export function AugmentationAccordion(props: IProps): React.ReactElement { } } + if(typeof props.aug.info === 'string') { + return ( + {displayName}} + panelContent={

} + /> + ) + } + return ( {displayName}} - panelContent={

} + panelContent={

{props.aug.info}

} /> ) }