mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Reset styles for html changelogs in getUpdateText
Adds an optional sxProps to the DialogBox component.
This commit is contained in:
parent
c4ddb5ef64
commit
8a2cad6c4a
@ -22,6 +22,7 @@ import { v1APIBreak } from "./utils/v1APIBreak";
|
|||||||
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
|
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
|
||||||
import { PlayerOwnedAugmentation } from "./Augmentation/PlayerOwnedAugmentation";
|
import { PlayerOwnedAugmentation } from "./Augmentation/PlayerOwnedAugmentation";
|
||||||
import { LocationName } from "./Locations/data/LocationNames";
|
import { LocationName } from "./Locations/data/LocationNames";
|
||||||
|
import { SxProps } from "@mui/system";
|
||||||
|
|
||||||
/* SaveObject.js
|
/* SaveObject.js
|
||||||
* Defines the object used to save/load games
|
* 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 {
|
function createNewUpdateText(): void {
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() =>
|
() =>
|
||||||
@ -379,6 +392,7 @@ function createNewUpdateText(): void {
|
|||||||
"Please report any bugs/issues through the github repository " +
|
"Please report any bugs/issues through the github repository " +
|
||||||
"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>" +
|
"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>" +
|
||||||
CONSTANTS.LatestUpdate,
|
CONSTANTS.LatestUpdate,
|
||||||
|
resets,
|
||||||
),
|
),
|
||||||
1000,
|
1000,
|
||||||
);
|
);
|
||||||
@ -391,6 +405,7 @@ function createBetaUpdateText(): void {
|
|||||||
"Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) " +
|
"Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) " +
|
||||||
"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>" +
|
"or the Bitburner subreddit (reddit.com/r/bitburner).<br><br>" +
|
||||||
CONSTANTS.LatestUpdate,
|
CONSTANTS.LatestUpdate,
|
||||||
|
resets,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import { AlertEvents } from "./AlertManager";
|
import { AlertEvents } from "./AlertManager";
|
||||||
|
|
||||||
import React from "react";
|
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") {
|
if (typeof txt !== "string") {
|
||||||
AlertEvents.emit(txt);
|
AlertEvents.emit(txt);
|
||||||
} else {
|
} else {
|
||||||
AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);
|
AlertEvents.emit(<Typography component="span" sx={styles} dangerouslySetInnerHTML={{ __html: txt }} />);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user