This commit is contained in:
Olivier Gagnon 2021-10-03 21:44:15 -04:00
commit 4fc6d393e4
8 changed files with 24 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -122,11 +122,22 @@ function WarehouseRoot(props: IProps): React.ReactElement {
</>
);
}
console.log(division.products);
for (const prodName in division.products) {
const prod = division.products[prodName];
if (prod === undefined) continue;
breakdown = (
<>
{breakdown}
{prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, "0,0.0")}
</>
);
}
return (
<Paper>
<Box display="flex" alignItems="center">
<Tooltip title={props.warehouse.sizeUsed !== 0 ? breakdown : ""}>
<Tooltip title={props.warehouse.sizeUsed !== 0 ? <Typography>{breakdown}</Typography> : ""}>
<Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? "error" : "primary"}>
Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{" "}
{numeralWrapper.formatBigNumber(props.warehouse.size)}

@ -409,7 +409,6 @@ export class Sleeve extends Person {
return jobPerformance * this.company_rep_mult * favorMult;
} else {
console.warn(`Sleeve.getRepGain() called for invalid task type: ${this.currentTask}`);
return 0;
}
}

@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import { EventEmitter } from "../../utils/EventEmitter";
import { Modal } from "../../ui/React/Modal";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
export const AlertEvents = new EventEmitter<[string | JSX.Element]>();
@ -41,7 +42,9 @@ export function AlertManager(): React.ReactElement {
<>
{alerts.length > 0 && (
<Modal open={true} onClose={close}>
<Typography>{alerts[0].text}</Typography>
<Box>
<Typography>{alerts[0].text}</Typography>
</Box>
</Modal>
)}
</>

@ -6,6 +6,6 @@ export function dialogBoxCreate(txt: string | JSX.Element): void {
if (typeof txt !== "string") {
AlertEvents.emit(txt);
} else {
AlertEvents.emit(<pre dangerouslySetInnerHTML={{ __html: txt }} />);
AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);
}
}

@ -147,10 +147,10 @@ function LogWindow(props: IProps): React.ReactElement {
</Box>
</Paper>
<Paper>
<Box maxHeight="25vh" overflow="scroll">
<Box maxHeight="25vh" overflow="scroll" sx={{ overflowWrap: "break-word" }}>
{props.script.logs.map(
(line: string, i: number): JSX.Element => (
<Typography key={i} style={{ whiteSpace: "pre-line" }}>
<Typography key={i}>
{line}
<br />
</Typography>