diff --git a/src/Achievements/AchievementList.tsx b/src/Achievements/AchievementList.tsx index 655a36abd..74d574bd7 100644 --- a/src/Achievements/AchievementList.tsx +++ b/src/Achievements/AchievementList.tsx @@ -118,7 +118,7 @@ export function AchievementList({ achievements, playerAchievements }: IProps): J {secret.map((item) => ( - +
))} diff --git a/src/Bladeburner/ui/BlackOpPage.tsx b/src/Bladeburner/ui/BlackOpPage.tsx index 99afa2ee5..3426dde7d 100644 --- a/src/Bladeburner/ui/BlackOpPage.tsx +++ b/src/Bladeburner/ui/BlackOpPage.tsx @@ -30,7 +30,7 @@ export function BlackOpPage(props: IProps): React.ReactElement {
{props.bladeburner.blackops[BlackOperationName.OperationDaedalus] ? ( ) : ( diff --git a/src/Faction/ui/FactionsRoot.tsx b/src/Faction/ui/FactionsRoot.tsx index 7290cf9bb..ad13f0698 100644 --- a/src/Faction/ui/FactionsRoot.tsx +++ b/src/Faction/ui/FactionsRoot.tsx @@ -136,7 +136,7 @@ const FactionElement = (props: FactionElementProps): React.ReactElement => { ) : ( - + )} diff --git a/src/Locations/ui/GenericLocation.tsx b/src/Locations/ui/GenericLocation.tsx index e6f589f26..5f70c8063 100644 --- a/src/Locations/ui/GenericLocation.tsx +++ b/src/Locations/ui/GenericLocation.tsx @@ -21,8 +21,6 @@ import { CasinoLocation } from "./CasinoLocation"; import { Location } from "../Location"; import { LocationType } from "@enums"; -import { Settings } from "../../Settings/Settings"; - import { isBackdoorInstalled } from "../../Server/ServerHelpers"; import { GetServer } from "../../Server/AllServers"; @@ -97,10 +95,10 @@ export function GenericLocation({ loc }: IProps): React.ReactElement { <> - {backdoorInstalled && !Settings.DisableTextEffects ? ( - + {backdoorInstalled ? ( + - + ) : ( diff --git a/src/Locations/ui/SpecialLocation.tsx b/src/Locations/ui/SpecialLocation.tsx index 83de3faa3..ccbafd279 100644 --- a/src/Locations/ui/SpecialLocation.tsx +++ b/src/Locations/ui/SpecialLocation.tsx @@ -303,7 +303,7 @@ export function SpecialLocation(props: SpecialLocationProps): React.ReactElement return ( <> - + ); diff --git a/src/ui/MD/a.tsx b/src/ui/MD/a.tsx index 2263634c5..317795c43 100644 --- a/src/ui/MD/a.tsx +++ b/src/ui/MD/a.tsx @@ -28,7 +28,7 @@ export const A = (props: React.PropsWithChildren<{ href?: string }>): React.Reac cursor: "pointer", }} > - + ); return ( diff --git a/src/ui/React/CorruptableText.tsx b/src/ui/React/CorruptableText.tsx index 7324de6ce..9ecfee9b6 100644 --- a/src/ui/React/CorruptableText.tsx +++ b/src/ui/React/CorruptableText.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from "react"; +import { Settings } from "../../Settings/Settings"; function replace(str: string, i: number, char: string): string { return str.substring(0, i) + char + str.substring(i + 1); @@ -6,13 +7,18 @@ function replace(str: string, i: number, char: string): string { interface CorruptableTextProps { content: string; + spoiler: boolean; } -function randomize(char: string): string { +function randomize(char: string, obfuscate: boolean): string { const randFrom = (str: string): string => str[Math.floor(Math.random() * str.length)]; const classes = ["abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "1234567890", " _", "()[]{}<>"]; const other = `!@#$%^&*()_+|\\';"/.,?\`~`; + if (obfuscate && Math.random() < 0.75) { + return randFrom(other); + } + for (const c of classes) { if (c.includes(char)) return randFrom(c); } @@ -24,6 +30,10 @@ export function CorruptableText(props: CorruptableTextProps): JSX.Element { const [content, setContent] = useState(props.content); useEffect(() => { + if (Settings.DisableTextEffects) { + return; + } + let counter = 5; const timers: number[] = []; const intervalId = setInterval(() => { @@ -32,7 +42,7 @@ export function CorruptableText(props: CorruptableTextProps): JSX.Element { counter = Math.random() * 5; const index = Math.random() * props.content.length; const letter = props.content.charAt(index); - setContent((content) => replace(content, index, randomize(letter))); + setContent((content) => replace(content, index, randomize(letter, false))); timers.push( window.setTimeout(() => { setContent((content) => replace(content, index, letter)); @@ -46,5 +56,10 @@ export function CorruptableText(props: CorruptableTextProps): JSX.Element { }; }, [props.content]); + if (Settings.DisableTextEffects) { + const spoileredContent = content.replaceAll(/./g, (c) => randomize(c, true)); + return {props.spoiler ? spoileredContent : content}; + } + return {content}; }