fix logbox newlines and corp researching multiple times

This commit is contained in:
Olivier Gagnon 2021-10-04 12:37:19 -04:00
parent d21382e96e
commit c989e6713f
5 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -122,7 +122,7 @@ function WarehouseRoot(props: IProps): React.ReactElement {
</> </>
); );
} }
console.log(division.products);
for (const prodName in division.products) { for (const prodName in division.products) {
const prod = division.products[prodName]; const prod = division.products[prodName];
if (prod === undefined) continue; if (prod === undefined) continue;

@ -25,7 +25,7 @@ function Upgrade({ n, division }: INodeProps): React.ReactElement {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
if (n === null) return <></>; if (n === null) return <></>;
const r = ResearchMap[n.text]; const r = ResearchMap[n.text];
let disabled = division.sciResearch.qty < r.cost; let disabled = division.sciResearch.qty < r.cost || n.researched;
const parent = n.parent; const parent = n.parent;
if (parent !== null) { if (parent !== null) {
disabled = disabled || !parent.researched; disabled = disabled || !parent.researched;

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