// Root React Component for the Corporation UI
import React, { useState, useEffect } from "react";
import { Theme } from "@mui/material/styles";
import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles";
import { numeralWrapper } from "../../ui/numeralFormat";
import { Reputation } from "./Reputation";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import Paper from "@mui/material/Paper";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import IconButton from "@mui/material/IconButton";
import SaveIcon from "@mui/icons-material/Save";
import { Settings } from "../../Settings/Settings";
import { use } from "../Context";
interface IProps {
save: () => void;
}
function Intelligence(): React.ReactElement {
const player = use.Player();
const classes = useStyles();
if (player.intelligence === 0) return <>>;
return (
Int {numeralWrapper.formatSkill(player.intelligence)}
{/*Hook for player scripts*/}
);
}
function Work(): React.ReactElement {
const player = use.Player();
const router = use.Router();
const classes = useStyles();
if (!player.isWorking || player.focus) return <>>;
return (
<>
Work in progress:
+ rep
>
);
}
const useStyles = makeStyles((theme: Theme) =>
createStyles({
cellNone: {
borderBottom: "none",
padding: 0,
margin: 0,
},
cell: {
padding: 0,
margin: 0,
},
hp: {
color: theme.colors.hp,
},
money: {
color: theme.colors.money,
},
hack: {
color: theme.colors.hack,
},
combat: {
color: theme.colors.combat,
},
cha: {
color: theme.colors.cha,
},
int: {
color: theme.colors.int,
},
}),
);
export function CharacterOverview({ save }: IProps): React.ReactElement {
const player = use.Player();
const setRerender = useState(false)[1];
useEffect(() => {
const id = setInterval(() => setRerender((old) => !old), 600);
return () => clearInterval(id);
}, []);
const classes = useStyles();
return (
HP
{numeralWrapper.formatHp(player.hp)} / {numeralWrapper.formatHp(player.max_hp)}
{/*Hook for player scripts*/}
Money
{numeralWrapper.formatMoney(player.money.toNumber())}
{/*Hook for player scripts*/}
Hack
{numeralWrapper.formatSkill(player.hacking_skill)}
{/*Hook for player scripts*/}
Str
{numeralWrapper.formatSkill(player.strength)}
{/*Hook for player scripts*/}
Def {numeralWrapper.formatSkill(player.defense)}
{/*Hook for player scripts*/}
Dex
{numeralWrapper.formatSkill(player.dexterity)}
{/*Hook for player scripts*/}
Agi {numeralWrapper.formatSkill(player.agility)}
{/*Hook for player scripts*/}
Cha {numeralWrapper.formatSkill(player.charisma)}
{/*Hook for player scripts*/}
{/*Hook for player scripts*/}
{/*Hook for player scripts*/}
{/*Hook for player scripts*/}