mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
rm some stuff from netdef to make it work in-game
This commit is contained in:
parent
ea2f2bd92b
commit
5126d72742
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:
|
||||
break;
|
||||
}
|
||||
let favorMult = 1 + faction.favor / 100;
|
||||
if (isNaN(favorMult)) {
|
||||
favorMult = 1;
|
||||
}
|
||||
this.workRepGainRate *= favorMult;
|
||||
this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;
|
||||
|
||||
//Cap the number of cycles being processed to whatever would put you at limit (20 hours)
|
||||
|
7
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
7
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@ -3883,7 +3881,6 @@ interface UserInterface {
|
||||
*/
|
||||
resetTheme(): void;
|
||||
|
||||
|
||||
/**
|
||||
* Get the current styles
|
||||
* @remarks
|
||||
@ -6393,6 +6390,6 @@ interface UserInterfaceTheme {
|
||||
* @internal
|
||||
*/
|
||||
interface IStyleSettings {
|
||||
fontFamily: React.CSSProperties["fontFamily"];
|
||||
lineHeight: React.CSSProperties["lineHeight"];
|
||||
fontFamily: string;
|
||||
lineHeight: number;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import Typography from "@mui/material/Typography";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import TextField from "@mui/material/TextField";
|
||||
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 { Settings } from "../../Settings/Settings";
|
||||
@ -26,16 +26,16 @@ interface FontFamilyProps {
|
||||
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 [fontFamily, setFontFamily] = useState<React.CSSProperties["fontFamily"]>(value);
|
||||
|
||||
function update(newValue: React.CSSProperties["fontFamily"]): void {
|
||||
setFontFamily(newValue);
|
||||
if (!newValue) {
|
||||
setErrorText('Must have a value');
|
||||
setErrorText("Must have a value");
|
||||
} else {
|
||||
setErrorText('');
|
||||
setErrorText("");
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ function FontFamilyField({ value, onChange, refreshId } : FontFamilyProps): Reac
|
||||
onChange={onTextChange}
|
||||
fullWidth
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
interface LineHeightProps {
|
||||
@ -65,18 +65,18 @@ interface LineHeightProps {
|
||||
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 [lineHeight, setLineHeight] = useState<React.CSSProperties["lineHeight"]>(value);
|
||||
|
||||
function update(newValue: React.CSSProperties["lineHeight"]): void {
|
||||
setLineHeight(newValue);
|
||||
if (!newValue) {
|
||||
setErrorText('Must have a value');
|
||||
setErrorText("Must have a value");
|
||||
} else if (isNaN(Number(newValue))) {
|
||||
setErrorText('Must be a number');
|
||||
setErrorText("Must be a number");
|
||||
} else {
|
||||
setErrorText('');
|
||||
setErrorText("");
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ function LineHeightField({ value, onChange, refreshId } : LineHeightProps): Reac
|
||||
helperText={errorText}
|
||||
onChange={onTextChange}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function StyleEditorModal(props: IProps): React.ReactElement {
|
||||
@ -116,7 +116,7 @@ export function StyleEditorModal(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
function setDefaults(): void {
|
||||
const styles = {...defaultStyles}
|
||||
const styles = { ...defaultStyles };
|
||||
setCustomStyle(styles);
|
||||
persistToSettings(styles);
|
||||
setRefreshId(refreshId + 1);
|
||||
@ -133,16 +133,23 @@ export function StyleEditorModal(props: IProps): React.ReactElement {
|
||||
<Modal open={props.open} onClose={props.onClose}>
|
||||
<Typography variant="h6">Styles Editor</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>
|
||||
<Paper sx={{ p: 2, my: 2 }}>
|
||||
<FontFamilyField value={customStyle.fontFamily} refreshId={refreshId}
|
||||
onChange={(value, error) => update({ ...customStyle, fontFamily: value }, error)} />
|
||||
<FontFamilyField
|
||||
value={customStyle.fontFamily}
|
||||
refreshId={refreshId}
|
||||
onChange={(value, error) => update({ ...customStyle, fontFamily: value as any }, error)}
|
||||
/>
|
||||
<br />
|
||||
<LineHeightField value={customStyle.lineHeight} refreshId={refreshId}
|
||||
onChange={(value, error) => update({ ...customStyle, lineHeight: value }, error)} />
|
||||
<LineHeightField
|
||||
value={customStyle.lineHeight}
|
||||
refreshId={refreshId}
|
||||
onChange={(value, error) => update({ ...customStyle, lineHeight: value as any }, error)}
|
||||
/>
|
||||
<br />
|
||||
<ButtonGroup sx={{ my: 1}}>
|
||||
<ButtonGroup sx={{ my: 1 }}>
|
||||
<Button onClick={setDefaults} startIcon={<ReplyIcon />} color="secondary" variant="outlined">
|
||||
Revert to Defaults
|
||||
</Button>
|
||||
|
Loading…
Reference in New Issue
Block a user