bitburner-src/src/ui/React/WorldMap.tsx

77 lines
4.7 KiB
TypeScript
Raw Normal View History

import React from "react";
import { CityName } from "../../Locations/data/CityNames";
2021-09-25 09:09:27 +02:00
import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import { Theme } from "@mui/material/styles";
import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles";
interface ICityProps {
currentCity: CityName;
city: CityName;
onTravel: (city: CityName) => void;
}
const useStyles = makeStyles((theme: Theme) =>
createStyles({
travel: {
color: theme.colors.white,
lineHeight: "1em",
whiteSpace: "pre",
cursor: "pointer"
},
})
);
function City(props: ICityProps): React.ReactElement {
const classes = useStyles();
if (props.city !== props.currentCity) {
return (
2021-10-01 22:22:33 +02:00
<Tooltip title={<Typography>{props.city}</Typography>}>
2021-09-25 17:23:56 +02:00
<span
onClick={() => props.onTravel(props.city)}
className={classes.travel}
2021-09-25 17:23:56 +02:00
>
2021-09-25 09:09:27 +02:00
{props.city[0]}
</span>
</Tooltip>
);
}
return <span>{props.city[0]}</span>;
}
interface IProps {
currentCity: CityName;
onTravel: (city: CityName) => void;
}
export function WorldMap(props: IProps): React.ReactElement {
// prettier-ignore
return (
2021-10-01 07:00:50 +02:00
<>
2021-09-25 17:23:56 +02:00
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,_ . ._. _. .</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> , _-\','|~\~ ~/ ;-'_ _-' ,;_;_, ~~-</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> /~~-\_/-'~'--' \~~| ', ,' / / ~|-_\_/~/~ ~~--~~~~'--_</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,/'-/~ '\ ,' _ , '<City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Volhaven} />,'|~ ._/-, /~</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~/-'~\_, '-,| '|. ' ~ ,\ /'~ / /_ /~</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>.-~ '| '',\~|\ _\~ ,_ , <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Chongqing} /> /,</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Sector12} /> /'~ |_/~\\,-,~ \ " ,_,/ |</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | / ._-~'\_ _~| \ ) <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.NewTokyo} /></Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \ __-\ '/ ~ |\ \_ / ~</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ., '\ |, ~-_ - | \\_' ~| /\ \~ ,</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~-_' _; '\ '-, \,' /\/ |</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\_,~'\_ \_ _, /' ' |, /|'</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / \_ ~ | / \ ~'; -,_.</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ~\ | | , '-_, ,; ~ ~\</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \, <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Aevum} /> / \ / /| ,-, , -,</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,/ | |' |/ ,- ~ \ '.</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,| ,/ \ ,/ \ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Ishima} /> |</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / | ~ -~~-, / _</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,-' ~ /</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,' ~</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ',| ~</Typography>
<Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~'</Typography>
2021-10-01 07:00:50 +02:00
</>
);
}