Merge pull request #2103 from mikomyazaki/dev-options-add-minimise-server-money

Adds dev options to set server(s) cash to zero
This commit is contained in:
hydroflame 2021-12-22 12:14:31 -05:00 committed by GitHub
commit e83c38b5fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,6 +71,20 @@ export function Servers(): React.ReactElement {
} }
} }
function minMoney(): void {
const s = GetServer(server);
if (s === null) return;
if (!(s instanceof Server)) return;
s.moneyAvailable = 0;
}
function minAllMoney(): void {
for (const s of GetAllServers()) {
if (!(s instanceof Server)) return;
s.moneyAvailable = 0;
}
}
return ( return (
<Accordion TransitionProps={{ unmountOnExit: true }}> <Accordion TransitionProps={{ unmountOnExit: true }}>
<AccordionSummary expandIcon={<ExpandMoreIcon />}> <AccordionSummary expandIcon={<ExpandMoreIcon />}>
@ -119,6 +133,12 @@ export function Servers(): React.ReactElement {
<td> <td>
<Typography>Money:</Typography> <Typography>Money:</Typography>
</td> </td>
<td>
<Button onClick={minMoney}>Min one</Button>
</td>
<td>
<Button onClick={minAllMoney}>Min all</Button>
</td>
<td> <td>
<Button onClick={maxMoney}>Max one</Button> <Button onClick={maxMoney}>Max one</Button>
</td> </td>