rm some stuff from netdef to make it work in-game

This commit is contained in:
Olivier Gagnon 2022-01-13 14:17:54 -05:00
parent ea2f2bd92b
commit 5126d72742
5 changed files with 29 additions and 30 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -946,11 +946,6 @@ export function workForFaction(this: IPlayer, numCycles: number): boolean {
default: default:
break; break;
} }
let favorMult = 1 + faction.favor / 100;
if (isNaN(favorMult)) {
favorMult = 1;
}
this.workRepGainRate *= favorMult;
this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain; this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;
//Cap the number of cycles being processed to whatever would put you at limit (20 hours) //Cap the number of cycles being processed to whatever would put you at limit (20 hours)

@ -1,5 +1,3 @@
import React from 'react';
/** /**
* @public * @public
*/ */
@ -3883,7 +3881,6 @@ interface UserInterface {
*/ */
resetTheme(): void; resetTheme(): void;
/** /**
* Get the current styles * Get the current styles
* @remarks * @remarks
@ -6393,6 +6390,6 @@ interface UserInterfaceTheme {
* @internal * @internal
*/ */
interface IStyleSettings { interface IStyleSettings {
fontFamily: React.CSSProperties["fontFamily"]; fontFamily: string;
lineHeight: React.CSSProperties["lineHeight"]; lineHeight: number;
} }

@ -7,7 +7,7 @@ import Typography from "@mui/material/Typography";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
import TextField from "@mui/material/TextField"; import TextField from "@mui/material/TextField";
import ReplyIcon from "@mui/icons-material/Reply"; import ReplyIcon from "@mui/icons-material/Reply";
import SaveIcon from '@mui/icons-material/Save'; import SaveIcon from "@mui/icons-material/Save";
import { ThemeEvents } from "./Theme"; import { ThemeEvents } from "./Theme";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
@ -26,16 +26,16 @@ interface FontFamilyProps {
refreshId: number; refreshId: number;
} }
function FontFamilyField({ value, onChange, refreshId } : FontFamilyProps): React.ReactElement { function FontFamilyField({ value, onChange, refreshId }: FontFamilyProps): React.ReactElement {
const [errorText, setErrorText] = useState<string | undefined>(); const [errorText, setErrorText] = useState<string | undefined>();
const [fontFamily, setFontFamily] = useState<React.CSSProperties["fontFamily"]>(value); const [fontFamily, setFontFamily] = useState<React.CSSProperties["fontFamily"]>(value);
function update(newValue: React.CSSProperties["fontFamily"]): void { function update(newValue: React.CSSProperties["fontFamily"]): void {
setFontFamily(newValue); setFontFamily(newValue);
if (!newValue) { if (!newValue) {
setErrorText('Must have a value'); setErrorText("Must have a value");
} else { } else {
setErrorText(''); setErrorText("");
} }
} }
@ -56,7 +56,7 @@ function FontFamilyField({ value, onChange, refreshId } : FontFamilyProps): Reac
onChange={onTextChange} onChange={onTextChange}
fullWidth fullWidth
/> />
) );
} }
interface LineHeightProps { interface LineHeightProps {
@ -65,18 +65,18 @@ interface LineHeightProps {
refreshId: number; refreshId: number;
} }
function LineHeightField({ value, onChange, refreshId } : LineHeightProps): React.ReactElement { function LineHeightField({ value, onChange, refreshId }: LineHeightProps): React.ReactElement {
const [errorText, setErrorText] = useState<string | undefined>(); const [errorText, setErrorText] = useState<string | undefined>();
const [lineHeight, setLineHeight] = useState<React.CSSProperties["lineHeight"]>(value); const [lineHeight, setLineHeight] = useState<React.CSSProperties["lineHeight"]>(value);
function update(newValue: React.CSSProperties["lineHeight"]): void { function update(newValue: React.CSSProperties["lineHeight"]): void {
setLineHeight(newValue); setLineHeight(newValue);
if (!newValue) { if (!newValue) {
setErrorText('Must have a value'); setErrorText("Must have a value");
} else if (isNaN(Number(newValue))) { } else if (isNaN(Number(newValue))) {
setErrorText('Must be a number'); setErrorText("Must be a number");
} else { } else {
setErrorText(''); setErrorText("");
} }
} }
@ -96,7 +96,7 @@ function LineHeightField({ value, onChange, refreshId } : LineHeightProps): Reac
helperText={errorText} helperText={errorText}
onChange={onTextChange} onChange={onTextChange}
/> />
) );
} }
export function StyleEditorModal(props: IProps): React.ReactElement { export function StyleEditorModal(props: IProps): React.ReactElement {
@ -116,7 +116,7 @@ export function StyleEditorModal(props: IProps): React.ReactElement {
} }
function setDefaults(): void { function setDefaults(): void {
const styles = {...defaultStyles} const styles = { ...defaultStyles };
setCustomStyle(styles); setCustomStyle(styles);
persistToSettings(styles); persistToSettings(styles);
setRefreshId(refreshId + 1); setRefreshId(refreshId + 1);
@ -133,16 +133,23 @@ export function StyleEditorModal(props: IProps): React.ReactElement {
<Modal open={props.open} onClose={props.onClose}> <Modal open={props.open} onClose={props.onClose}>
<Typography variant="h6">Styles Editor</Typography> <Typography variant="h6">Styles Editor</Typography>
<Typography> <Typography>
WARNING: Changing styles <strong>may mess up</strong> the interface. Drastic changes are <strong>NOT recommended</strong>. WARNING: Changing styles <strong>may mess up</strong> the interface. Drastic changes are{" "}
<strong>NOT recommended</strong>.
</Typography> </Typography>
<Paper sx={{ p: 2, my: 2 }}> <Paper sx={{ p: 2, my: 2 }}>
<FontFamilyField value={customStyle.fontFamily} refreshId={refreshId} <FontFamilyField
onChange={(value, error) => update({ ...customStyle, fontFamily: value }, error)} /> value={customStyle.fontFamily}
refreshId={refreshId}
onChange={(value, error) => update({ ...customStyle, fontFamily: value as any }, error)}
/>
<br /> <br />
<LineHeightField value={customStyle.lineHeight} refreshId={refreshId} <LineHeightField
onChange={(value, error) => update({ ...customStyle, lineHeight: value }, error)} /> value={customStyle.lineHeight}
refreshId={refreshId}
onChange={(value, error) => update({ ...customStyle, lineHeight: value as any }, error)}
/>
<br /> <br />
<ButtonGroup sx={{ my: 1}}> <ButtonGroup sx={{ my: 1 }}>
<Button onClick={setDefaults} startIcon={<ReplyIcon />} color="secondary" variant="outlined"> <Button onClick={setDefaults} startIcon={<ReplyIcon />} color="secondary" variant="outlined">
Revert to Defaults Revert to Defaults
</Button> </Button>