mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 12:27:07 +02:00
rebuild
This commit is contained in:
@@ -493,6 +493,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
}}
|
||||
value={timestampFormat}
|
||||
onChange={handleTimestampFormatChange}
|
||||
placeholder="yyyy-MM-dd hh:mm:ss"
|
||||
/>
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
||||
@@ -14,6 +14,7 @@ import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
||||
import { workerScripts } from "../../Netscript/WorkerScripts";
|
||||
import { startWorkerScript } from "../../NetscriptWorker";
|
||||
import { GetServer } from "../../Server/AllServers";
|
||||
import { Theme } from "@mui/material";
|
||||
|
||||
let layerCounter = 0;
|
||||
|
||||
@@ -65,7 +66,7 @@ interface IProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles(() =>
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
logs: {
|
||||
overflowY: "scroll",
|
||||
@@ -74,6 +75,21 @@ const useStyles = makeStyles(() =>
|
||||
display: "flex",
|
||||
flexDirection: "column-reverse",
|
||||
},
|
||||
success: {
|
||||
color: theme.colors.success,
|
||||
},
|
||||
error: {
|
||||
color: theme.palette.error.main,
|
||||
},
|
||||
primary: {
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
info: {
|
||||
color: theme.palette.info.main,
|
||||
},
|
||||
warning: {
|
||||
color: theme.palette.warning.main,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -117,6 +133,22 @@ function LogWindow(props: IProps): React.ReactElement {
|
||||
return t.slice(0, maxLength - 3) + "...";
|
||||
}
|
||||
|
||||
function lineClass(s: string): string {
|
||||
if (s.startsWith("ERROR") || s.startsWith("FAIL")) {
|
||||
return classes.error;
|
||||
}
|
||||
if (s.startsWith("SUCCESS")) {
|
||||
return classes.success;
|
||||
}
|
||||
if (s.startsWith("WARN")) {
|
||||
return classes.warning;
|
||||
}
|
||||
if (s.startsWith("INFO")) {
|
||||
return classes.info;
|
||||
}
|
||||
return classes.primary;
|
||||
}
|
||||
|
||||
return (
|
||||
<Draggable handle=".drag">
|
||||
<Paper
|
||||
@@ -162,7 +194,7 @@ function LogWindow(props: IProps): React.ReactElement {
|
||||
<Box>
|
||||
{props.script.logs.map(
|
||||
(line: string, i: number): JSX.Element => (
|
||||
<Typography key={i}>
|
||||
<Typography key={i} className={lineClass(line)}>
|
||||
{line}
|
||||
<br />
|
||||
</Typography>
|
||||
|
||||
@@ -18,6 +18,9 @@ declare module "@mui/material/styles" {
|
||||
backgroundprimary: React.CSSProperties["color"];
|
||||
backgroundsecondary: React.CSSProperties["color"];
|
||||
button: React.CSSProperties["color"];
|
||||
successlight: React.CSSProperties["color"];
|
||||
success: React.CSSProperties["color"];
|
||||
successdark: React.CSSProperties["color"];
|
||||
};
|
||||
}
|
||||
interface ThemeOptions {
|
||||
@@ -32,6 +35,9 @@ declare module "@mui/material/styles" {
|
||||
backgroundprimary: React.CSSProperties["color"];
|
||||
backgroundsecondary: React.CSSProperties["color"];
|
||||
button: React.CSSProperties["color"];
|
||||
successlight: React.CSSProperties["color"];
|
||||
success: React.CSSProperties["color"];
|
||||
successdark: React.CSSProperties["color"];
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -51,6 +57,9 @@ export function refreshTheme(): void {
|
||||
backgroundprimary: Settings.theme.backgroundprimary,
|
||||
backgroundsecondary: Settings.theme.backgroundsecondary,
|
||||
button: Settings.theme.button,
|
||||
successlight: Settings.theme.successlight,
|
||||
success: Settings.theme.success,
|
||||
successdark: Settings.theme.successdark,
|
||||
},
|
||||
palette: {
|
||||
primary: {
|
||||
|
||||
@@ -132,6 +132,27 @@ export function ThemeEditorModal(props: IProps): React.ReactElement {
|
||||
defaultColor={defaultSettings.theme["primarydark"]}
|
||||
/>
|
||||
|
||||
<br />
|
||||
|
||||
<ColorEditor
|
||||
name="successlight"
|
||||
onColorChange={onColorChange}
|
||||
color={customTheme["successlight"]}
|
||||
defaultColor={defaultSettings.theme["successlight"]}
|
||||
/>
|
||||
<ColorEditor
|
||||
name="success"
|
||||
onColorChange={onColorChange}
|
||||
color={customTheme["success"]}
|
||||
defaultColor={defaultSettings.theme["success"]}
|
||||
/>
|
||||
<ColorEditor
|
||||
name="successdark"
|
||||
onColorChange={onColorChange}
|
||||
color={customTheme["successdark"]}
|
||||
defaultColor={defaultSettings.theme["successdark"]}
|
||||
/>
|
||||
|
||||
<br />
|
||||
<ColorEditor
|
||||
name="errorlight"
|
||||
|
||||
Reference in New Issue
Block a user