From 8a2cad6c4a54bfccf2ee11373a331644fee309c0 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Tue, 25 Jan 2022 08:16:48 -0500 Subject: [PATCH] Reset styles for html changelogs in getUpdateText Adds an optional sxProps to the DialogBox component. --- src/SaveObject.tsx | 15 +++++++++++++++ src/ui/React/DialogBox.tsx | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index d9cae146a..eaa997269 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -22,6 +22,7 @@ import { v1APIBreak } from "./utils/v1APIBreak"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { PlayerOwnedAugmentation } from "./Augmentation/PlayerOwnedAugmentation"; import { LocationName } from "./Locations/data/LocationNames"; +import { SxProps } from "@mui/system"; /* SaveObject.js * Defines the object used to save/load games @@ -371,6 +372,18 @@ function createScamUpdateText(): void { } } +const resets: SxProps = { + "& h1, & h2, & h3, & h4, & p, & a, & ul": { + margin: 0, + color: Settings.theme.primary, + whiteSpace: "initial", + }, + "& ul": { + paddingLeft: "1.5em", + lineHeight: 1.5, + }, +}; + function createNewUpdateText(): void { setTimeout( () => @@ -379,6 +392,7 @@ function createNewUpdateText(): void { "Please report any bugs/issues through the github repository " + "or the Bitburner subreddit (reddit.com/r/bitburner).

" + CONSTANTS.LatestUpdate, + resets, ), 1000, ); @@ -391,6 +405,7 @@ function createBetaUpdateText(): void { "Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) " + "or the Bitburner subreddit (reddit.com/r/bitburner).

" + CONSTANTS.LatestUpdate, + resets, ); } diff --git a/src/ui/React/DialogBox.tsx b/src/ui/React/DialogBox.tsx index cc96d956f..9ae8035f6 100644 --- a/src/ui/React/DialogBox.tsx +++ b/src/ui/React/DialogBox.tsx @@ -1,11 +1,13 @@ import { AlertEvents } from "./AlertManager"; import React from "react"; +import { SxProps } from "@mui/system"; +import { Typography } from "@mui/material"; -export function dialogBoxCreate(txt: string | JSX.Element): void { +export function dialogBoxCreate(txt: string | JSX.Element, styles?: SxProps): void { if (typeof txt !== "string") { AlertEvents.emit(txt); } else { - AlertEvents.emit(); + AlertEvents.emit(); } }