update prettier

This commit is contained in:
Olivier Gagnon 2021-09-22 12:56:55 -04:00
parent c1945ab12e
commit 66a2adaeb4
31 changed files with 63988 additions and 2704 deletions

@ -1,18 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta charset="utf-8" />
<title>Bitburner</title>
<link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png"/>
<link rel="manifest" href="dist/site.webmanifest"/>
<link rel="mask-icon" href="dist/safari-pinned-tab.svg" color="#000000"/>
<meta name="apple-mobile-web-app-title" content="Bitburner"/>
<meta name="application-name" content="Bitburner"/>
<meta name="msapplication-TileColor" content="#000000"/>
<meta name="msapplication-config" content="dist/browserconfig.xml"/>
<meta name="theme-color" content="#ffffff"/>
<link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png" />
<link rel="manifest" href="dist/site.webmanifest" />
<link rel="mask-icon" href="dist/safari-pinned-tab.svg" color="#000000" />
<meta name="apple-mobile-web-app-title" content="Bitburner" />
<meta name="application-name" content="Bitburner" />
<meta name="msapplication-TileColor" content="#000000" />
<meta name="msapplication-config" content="dist/browserconfig.xml" />
<meta name="theme-color" content="#ffffff" />
<!-- Google Analytics -->
<script>
@ -36,7 +36,10 @@
ga("send", "pageview");
</script>
<link rel="shortcut icon" href="favicon.ico"><link href="dist/vendor.css" rel="stylesheet"><link href="main.css" rel="stylesheet"></head>
<link rel="shortcut icon" href="favicon.ico" />
<link href="dist/vendor.css" rel="stylesheet" />
<link href="main.css" rel="stylesheet" />
</head>
<body>
<div id="entire-game-container">
<div id="mainmenu-container" style="display: flex; flex-direction: row"></div>
@ -48,7 +51,9 @@
</div>
<div id="unclickable" style="display: none">Click on this to upgrade your Source-File -1!</div>
<script type="text/javascript" src="dist/vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body>
<script type="text/javascript" src="dist/vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>
</body>
<script src="src/ThirdParty/raphael.min.js"></script>
</html>

File diff suppressed because one or more lines are too long

4391
main.css

File diff suppressed because it is too large Load Diff

@ -2,25 +2,25 @@ const numSpaces = 4;
const maxLineLength = 160;
module.exports = {
"env": {
"es6": true,
"node": true
env: {
es6: true,
node: true,
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
extends: "eslint:recommended",
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
"ecmaVersion": 8,
"sourceType": "module"
ecmaVersion: 8,
sourceType: "module",
},
"rules": {
rules: {
"accessor-pairs": [
"error",
{
"getWithoutSet": false,
"setWithoutGet": true
}
getWithoutSet: false,
setWithoutGet: true,
},
],
"array-bracket-newline": ["error"],
"array-bracket-spacing": ["error"],
@ -33,50 +33,35 @@ module.exports = {
"block-spacing": ["error"],
"brace-style": ["error"],
"callback-return": ["error"],
"camelcase": ["error"],
camelcase: ["error"],
"capitalized-comments": ["error"],
"class-methods-use-this": ["error"],
"comma-dangle": ["error"],
"comma-spacing": ["error"],
"comma-style": [
"error",
"last"
],
"complexity": ["error"],
"computed-property-spacing": [
"error",
"never"
],
"comma-style": ["error", "last"],
complexity: ["error"],
"computed-property-spacing": ["error", "never"],
"consistent-return": ["error"],
"consistent-this": ["error"],
"constructor-super": ["error"],
"curly": ["error"],
curly: ["error"],
"default-case": ["error"],
"dot-location": [
"error",
"property"
],
"dot-location": ["error", "property"],
"dot-notation": ["error"],
"eol-last": ["error"],
"eqeqeq": ["error"],
eqeqeq: ["error"],
"for-direction": ["error"],
"func-call-spacing": ["error"],
"func-name-matching": ["error"],
"func-names": [
"error",
"never"
],
"func-names": ["error", "never"],
"func-style": ["error"],
"function-paren-newline": ["error"],
"generator-star-spacing": [
"error",
"before"
],
"generator-star-spacing": ["error", "before"],
"getter-return": [
"error",
{
"allowImplicit": false
}
allowImplicit: false,
},
],
"global-require": ["error"],
"guard-for-in": ["error"],
@ -84,52 +69,37 @@ module.exports = {
"id-blacklist": ["error"],
"id-length": ["error"],
"id-match": ["error"],
"implicit-arrow-linebreak": [
"error",
"beside"
],
"indent": [
"implicit-arrow-linebreak": ["error", "beside"],
indent: [
"error",
numSpaces,
{
"SwitchCase": 1
}
SwitchCase: 1,
},
],
"init-declarations": ["error"],
"jsx-quotes": ["error"],
"key-spacing": ["error"],
"keyword-spacing": ["error"],
"line-comment-position": ["error"],
"linebreak-style": [
"error",
"windows"
],
"linebreak-style": ["error", "windows"],
"lines-around-comment": ["error"],
"lines-between-class-members": ["error"],
"max-depth": ["error"],
"max-len": [
"error",
maxLineLength
],
"max-len": ["error", maxLineLength],
"max-lines": [
"error",
{
"skipBlankLines": true,
"skipComments": true
}
skipBlankLines: true,
skipComments: true,
},
],
"max-nested-callbacks": ["error"],
"max-params": ["error"],
"max-statements": ["error"],
"max-statements-per-line": ["error"],
"multiline-comment-style": [
"off",
"starred-block"
],
"multiline-ternary": [
"error",
"never"
],
"multiline-comment-style": ["off", "starred-block"],
"multiline-ternary": ["error", "never"],
"new-cap": ["error"],
"new-parens": ["error"],
// TODO: configure this...
@ -145,18 +115,15 @@ module.exports = {
"no-catch-shadow": ["error"],
"no-class-assign": ["error"],
"no-compare-neg-zero": ["error"],
"no-cond-assign": [
"error",
"except-parens"
],
"no-cond-assign": ["error", "except-parens"],
"no-confusing-arrow": ["error"],
"no-console": ["error"],
"no-const-assign": ["error"],
"no-constant-condition": [
"error",
{
"checkLoops": false
}
checkLoops: false,
},
],
"no-continue": ["off"],
"no-control-regex": ["error"],
@ -170,15 +137,15 @@ module.exports = {
"no-duplicate-imports": [
"error",
{
"includeExports": true
}
includeExports: true,
},
],
"no-else-return": ["error"],
"no-empty": [
"error",
{
"allowEmptyCatch": false
}
allowEmptyCatch: false,
},
],
"no-empty-character-class": ["error"],
"no-empty-function": ["error"],
@ -194,8 +161,8 @@ module.exports = {
"error",
"all",
{
"conditionalAssign": false
}
conditionalAssign: false,
},
],
"no-extra-semi": ["error"],
"no-fallthrough": ["error"],
@ -206,20 +173,17 @@ module.exports = {
"no-implicit-globals": ["error"],
"no-implied-eval": ["error"],
"no-inline-comments": ["error"],
"no-inner-declarations": [
"error",
"both"
],
"no-inner-declarations": ["error", "both"],
"no-invalid-regexp": ["error"],
"no-invalid-this": ["error"],
"no-irregular-whitespace": [
"error",
{
"skipComments": false,
"skipRegExps": false,
"skipStrings": false,
"skipTemplates": false
}
skipComments: false,
skipRegExps: false,
skipStrings: false,
skipTemplates: false,
},
],
"no-iterator": ["error"],
"no-label-var": ["error"],
@ -230,13 +194,9 @@ module.exports = {
"no-magic-numbers": [
"error",
{
"ignore": [
-1,
0,
1
],
"ignoreArrayIndexes": true
}
ignore: [-1, 0, 1],
ignoreArrayIndexes: true,
},
],
"no-mixed-operators": ["error"],
"no-mixed-requires": ["error"],
@ -247,8 +207,8 @@ module.exports = {
"no-multiple-empty-lines": [
"error",
{
"max": 1
}
max: 1,
},
],
"no-native-reassign": ["error"],
"no-negated-condition": ["error"],
@ -268,8 +228,8 @@ module.exports = {
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
allowForLoopAfterthoughts: true,
},
],
"no-process-env": ["error"],
"no-process-exit": ["error"],
@ -283,10 +243,10 @@ module.exports = {
"no-restricted-properties": [
"error",
{
"message": "'log' is too general, use an appropriate level when logging.",
"object": "console",
"property": "log"
}
message: "'log' is too general, use an appropriate level when logging.",
object: "console",
property: "log",
},
],
"no-restricted-syntax": ["error"],
"no-return-assign": ["error"],
@ -295,8 +255,8 @@ module.exports = {
"no-self-assign": [
"error",
{
"props": false
}
props: false,
},
],
"no-self-compare": ["error"],
"no-sequences": ["error"],
@ -333,10 +293,10 @@ module.exports = {
"no-useless-rename": [
"error",
{
"ignoreDestructuring": false,
"ignoreExport": false,
"ignoreImport": false
}
ignoreDestructuring: false,
ignoreExport: false,
ignoreImport: false,
},
],
"no-useless-return": ["error"],
"no-var": ["error"],
@ -344,10 +304,7 @@ module.exports = {
"no-warning-comments": ["error"],
"no-whitespace-before-property": ["error"],
"no-with": ["error"],
"nonblock-statement-body-position": [
"error",
"below"
],
"nonblock-statement-body-position": ["error", "below"],
"object-curly-newline": ["error"],
"object-curly-spacing": ["error"],
"object-property-newline": ["error"],
@ -355,10 +312,7 @@ module.exports = {
"one-var": ["off"],
"one-var-declaration-per-line": ["error"],
"operator-assignment": ["error"],
"operator-linebreak": [
"error",
"none"
],
"operator-linebreak": ["error", "none"],
"padded-blocks": ["off"],
"padding-line-between-statements": ["error"],
"prefer-arrow-callback": ["error"],
@ -371,24 +325,15 @@ module.exports = {
"prefer-spread": ["error"],
"prefer-template": ["error"],
"quote-props": ["error"],
"quotes": ["error"],
"radix": [
"error",
"as-needed"
],
quotes: ["error"],
radix: ["error", "as-needed"],
"require-await": ["error"],
"require-jsdoc": ["off"],
"require-yield": ["error"],
"rest-spread-spacing": [
"error",
"never"
],
"semi": ["error"],
"rest-spread-spacing": ["error", "never"],
semi: ["error"],
"semi-spacing": ["error"],
"semi-style": [
"error",
"last"
],
"semi-style": ["error", "last"],
"sort-imports": ["error"],
"sort-keys": ["error"],
"sort-vars": ["error"],
@ -398,37 +343,25 @@ module.exports = {
"space-infix-ops": ["error"],
"space-unary-ops": ["error"],
"spaced-comment": ["error"],
"strict": ["error"],
strict: ["error"],
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
after: true,
before: false,
},
],
"symbol-description": ["error"],
"template-curly-spacing": ["error"],
"template-tag-spacing": ["error"],
"unicode-bom": [
"error",
"never"
],
"unicode-bom": ["error", "never"],
"use-isnan": ["error"],
"valid-jsdoc": ["error"],
"valid-typeof": ["error"],
"vars-on-top": ["error"],
"wrap-iife": [
"error",
"any"
],
"wrap-iife": ["error", "any"],
"wrap-regex": ["error"],
"yield-star-spacing": [
"error",
"before"
],
"yoda": [
"error",
"never"
]
}
"yield-star-spacing": ["error", "before"],
yoda: ["error", "never"],
},
};

@ -8,16 +8,18 @@ const path = require("path");
const exec = require("child_process").exec;
const semver = require("./semver");
const getPackageJson = () => new Promise((resolve, reject) => {
const getPackageJson = () =>
new Promise((resolve, reject) => {
try {
/* eslint-disable-next-line global-require */
resolve(require(path.resolve(process.cwd(), "package.json")));
} catch (error) {
reject(error);
}
});
});
const getEngines = (data) => new Promise((resolve, reject) => {
const getEngines = (data) =>
new Promise((resolve, reject) => {
let versions = null;
if (data.engines) {
@ -29,9 +31,10 @@ const getEngines = (data) => new Promise((resolve, reject) => {
} else {
reject("Missing or improper 'engines' property in 'package.json'");
}
});
});
const checkNpmVersion = (engines) => new Promise((resolve, reject) => {
const checkNpmVersion = (engines) =>
new Promise((resolve, reject) => {
exec("npm -v", (error, stdout, stderr) => {
if (error) {
reject(`Unable to find NPM version\n${stderr}`);
@ -43,20 +46,25 @@ const checkNpmVersion = (engines) => new Promise((resolve, reject) => {
if (semver.satisfies(npmVersion, engineVersion)) {
resolve();
} else {
reject(`Incorrect npm version\n'package.json' specifies "${engineVersion}", you are currently running "${npmVersion}".`);
reject(
`Incorrect npm version\n'package.json' specifies "${engineVersion}", you are currently running "${npmVersion}".`,
);
}
});
});
});
const checkNodeVersion = (engines) => new Promise((resolve, reject) => {
const checkNodeVersion = (engines) =>
new Promise((resolve, reject) => {
const nodeVersion = process.version.substring(1);
if (semver.satisfies(nodeVersion, engines.node)) {
resolve(engines);
} else {
reject(`Incorrect node version\n'package.json' specifies "${engines.node}", you are currently running "${process.version}".`);
reject(
`Incorrect node version\n'package.json' specifies "${engines.node}", you are currently running "${process.version}".`,
);
}
});
});
getPackageJson()
.then(getEngines)
@ -69,5 +77,5 @@ getPackageJson()
/* eslint-disable no-console, no-process-exit */
console.error(error);
process.exit(1);
}
},
);

@ -444,7 +444,6 @@ function parseComparator(comp, loose) {
}
class SemVer {
/**
* A semantic version.
* @param {string} version The version.
@ -488,7 +487,7 @@ class SemVer {
// Numberify any prerelease numeric ids
if (matches[4]) {
this.prerelease = matches[4].split(".").map((id) => {
if ((/^[0-9]+$/).test(id)) {
if (/^[0-9]+$/.test(id)) {
const num = Number(id);
if (num >= 0 && num < MAX_SAFE_INTEGER) {
return num;
@ -532,7 +531,9 @@ class SemVer {
}
return (
compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch)
compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch)
);
}
@ -572,7 +573,8 @@ class SemVer {
}
}
const compare = (leftVersion, rightVersion, loose) => new SemVer(leftVersion, loose).compare(new SemVer(rightVersion, loose));
const compare = (leftVersion, rightVersion, loose) =>
new SemVer(leftVersion, loose).compare(new SemVer(rightVersion, loose));
const gt = (leftVersion, rightVersion, loose) => compare(leftVersion, rightVersion, loose) > 0;
const lt = (leftVersion, rightVersion, loose) => compare(leftVersion, rightVersion, loose) < 0;
const eq = (leftVersion, rightVersion, loose) => compare(leftVersion, rightVersion, loose) === 0;

@ -22,7 +22,8 @@ export function BlackOpList(props: IProps): React.ReactElement {
});
blackops = blackops.filter(
(blackop: BlackOperation, i: number) => !(
(blackop: BlackOperation, i: number) =>
!(
props.bladeburner.blackops[blackops[i].name] == null &&
i !== 0 &&
props.bladeburner.blackops[blackops[i - 1].name] == null

@ -62,7 +62,8 @@ export function CityTabs(props: IProps): React.ReactElement {
return (
<>
{Object.values(props.division.offices).map(
(office: OfficeSpace | 0) => office !== 0 && (
(office: OfficeSpace | 0) =>
office !== 0 && (
<CityTab
current={city === office.loc}
key={office.loc}

@ -20,7 +20,8 @@ function ExpandButton(props: IExpandButtonProps): React.ReactElement {
const allIndustries = Object.keys(Industries).sort();
const possibleIndustries = allIndustries
.filter(
(industryType: string) => props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,
(industryType: string) =>
props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,
)
.sort();
if (possibleIndustries.length === 0) return <></>;

@ -17,7 +17,8 @@ export function NewIndustryPopup(props: IProps): React.ReactElement {
const allIndustries = Object.keys(Industries).sort();
const possibleIndustries = allIndustries
.filter(
(industryType: string) => props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,
(industryType: string) =>
props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,
)
.sort();
const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : "");

@ -95,7 +95,9 @@ function BulkPurchase(props: IProps): React.ReactElement {
style={{ margin: "5px" }}
onKeyDown={onKeyDown}
/>
<button className="std-button" onClick={bulkPurchase}>Confirm Bulk Purchase</button>
<button className="std-button" onClick={bulkPurchase}>
Confirm Bulk Purchase
</button>
</>
);
}

@ -52,7 +52,7 @@ export function DonateOption(props: IProps): React.ReactElement {
const amt = numeralWrapper.parseMoney(event.target.value);
if (event.target.value === "" || isNaN(amt)) setDonateAmt(null);
else setDonateAmt(amt);
console.log('set')
console.log("set");
}
function donate(): void {

@ -91,7 +91,6 @@ export function FactionRoot(props: IProps): React.ReactElement {
});
}
// Route to the main faction page
function routeToMain(): void {
setPurchasingAugs(false);

@ -2,7 +2,7 @@
* React component for general information about the faction. This includes the
* factions "motto", reputation, favor, and gameplay instructions
*/
import React, {useState, useEffect} from "react";
import React, { useState, useEffect } from "react";
import { Faction } from "../../Faction/Faction";
import { FactionInfo } from "../../Faction/FactionInfo";

@ -225,8 +225,8 @@ export class GangMember {
def: this.calculateAscensionMult(this.def_asc_points),
dex: this.calculateAscensionMult(this.dex_asc_points),
agi: this.calculateAscensionMult(this.agi_asc_points),
cha: this.calculateAscensionMult(this.cha_asc_points)
}
cha: this.calculateAscensionMult(this.cha_asc_points),
};
}
getAscensionMultsAfterAscend(): IMults {
@ -238,7 +238,7 @@ export class GangMember {
dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),
agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),
cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),
}
};
}
getAscensionResults(): IMults {
@ -252,7 +252,7 @@ export class GangMember {
dex: postAscend.dex / preAscend.dex,
agi: postAscend.agi / preAscend.agi,
cha: postAscend.cha / preAscend.cha,
}
};
}
ascend(): IAscensionResult {

@ -74,17 +74,23 @@ export function AscensionPopup(props: IProps): React.ReactElement {
<br />
In return, they will gain the following permanent boost to stat multipliers:
<br />
Hacking: x{numeralWrapper.format(preAscend.hack, "0.000")} =&gt; x{numeralWrapper.format(postAscend.hack, "0.000")}
Hacking: x{numeralWrapper.format(preAscend.hack, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.hack, "0.000")}
<br />
Strength: x{numeralWrapper.format(preAscend.str, "0.000")} =&gt; x{numeralWrapper.format(postAscend.str, "0.000")}
Strength: x{numeralWrapper.format(preAscend.str, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.str, "0.000")}
<br />
Defense: x{numeralWrapper.format(preAscend.def, "0.000")} =&gt; x{numeralWrapper.format(postAscend.def, "0.000")}
Defense: x{numeralWrapper.format(preAscend.def, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.def, "0.000")}
<br />
Dexterity: x{numeralWrapper.format(preAscend.dex, "0.000")} =&gt; x{numeralWrapper.format(postAscend.dex, "0.000")}
Dexterity: x{numeralWrapper.format(preAscend.dex, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.dex, "0.000")}
<br />
Agility: x{numeralWrapper.format(preAscend.agi, "0.000")} =&gt; x{numeralWrapper.format(postAscend.agi, "0.000")}
Agility: x{numeralWrapper.format(preAscend.agi, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.agi, "0.000")}
<br />
Charisma: x{numeralWrapper.format(preAscend.cha, "0.000")} =&gt; x{numeralWrapper.format(postAscend.cha, "0.000")}
Charisma: x{numeralWrapper.format(preAscend.cha, "0.000")} =&gt; x
{numeralWrapper.format(postAscend.cha, "0.000")}
<br />
</pre>
<button className="std-button" onClick={confirm}>

@ -13,21 +13,17 @@ import { CoresButton } from "./CoresButton";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { getPurchaseServerCost } from "../../Server/ServerPurchases";
import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money";
import { createPopup } from "../../ui/React/createPopup";
import { PurchaseServerPopup } from "./PurchaseServerPopup";
type IProps = {
loc: Location;
p: IPlayer;
};
export function TechVendorLocation(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
function rerender(): void {
setRerender((old) => !old);
@ -40,7 +36,7 @@ export function TechVendorLocation(props: IProps): React.ReactElement {
cost: cost,
p: p,
popupId: popupId,
rerender: rerender
rerender: rerender,
});
}

@ -60,9 +60,11 @@ const SortFunctions: {
Dexterity: (a: Resleeve, b: Resleeve): number => a.dexterity - b.dexterity,
Agility: (a: Resleeve, b: Resleeve): number => a.agility - b.agility,
Charisma: (a: Resleeve, b: Resleeve): number => a.charisma - b.charisma,
AverageCombatStats: (a: Resleeve, b: Resleeve): number => getAverage(a.strength, a.defense, a.dexterity, a.agility) -
AverageCombatStats: (a: Resleeve, b: Resleeve): number =>
getAverage(a.strength, a.defense, a.dexterity, a.agility) -
getAverage(b.strength, b.defense, b.dexterity, b.agility),
AverageAllStats: (a: Resleeve, b: Resleeve): number => getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -
AverageAllStats: (a: Resleeve, b: Resleeve): number =>
getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -
getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma),
TotalNumAugmentations: (a: Resleeve, b: Resleeve): number => a.augmentations.length - b.augmentations.length,
};

@ -183,8 +183,10 @@ const canDo: {
"Work for Company": (player: IPlayer, sleeve: Sleeve) => possibleJobs(player, sleeve).length > 0,
"Work for Faction": (player: IPlayer, sleeve: Sleeve) => possibleFactions(player, sleeve).length > 0,
"Commit Crime": () => true,
"Take University Course": (player: IPlayer, sleeve: Sleeve) => [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Workout at Gym": (player: IPlayer, sleeve: Sleeve) => [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Take University Course": (player: IPlayer, sleeve: Sleeve) =>
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Workout at Gym": (player: IPlayer, sleeve: Sleeve) =>
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Shock Recovery": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,
Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,
};
@ -229,7 +231,8 @@ export function TaskSelector(props: IProps): React.ReactElement {
const [s1, setS1] = useState(abc[1]);
const [s2, setS2] = useState(abc[2]);
const validActions = Object.keys(canDo).filter((k) => (canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),
const validActions = Object.keys(canDo).filter((k) =>
(canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),
);
const detailsF = tasks[s0];

@ -25,7 +25,7 @@ import { WorkerScript } from "../../Netscript/WorkerScript";
import { Settings } from "../../Settings/Settings";
import { iTutorialNextStep, ITutorial, iTutorialSteps } from "../../InteractiveTutorial";
let loaded=false;
let loaded = false;
let symbols: string[] = [];
(function () {
const ns = NetscriptFunctions({} as WorkerScript);
@ -310,7 +310,7 @@ export function Root(props: IProps): React.ReactElement {
});
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, "netscript.d.ts");
monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, "netscript.d.ts");
loaded=true
loaded = true;
}
return (

@ -403,7 +403,7 @@ export class Terminal implements ITerminal {
if (player.hasProgram(Programs.AutoLink.name)) {
this.append(new Link(titleDashes, s.hostname));
} else {
this.print(titleDashes+s.hostname);
this.print(titleDashes + s.hostname);
}
const dashes = titleDashes + "--";

@ -93,7 +93,8 @@ export function TerminalRoot({ terminal, router, player }: IProps): React.ReactE
if (item instanceof Link)
return (
<ListItem key={i} classes={{ root: classes.nopadding }}>
<Typography>{item.dashes}&gt;&nbsp;</Typography><MuiLink
<Typography>{item.dashes}&gt;&nbsp;</Typography>
<MuiLink
classes={{ root: classes.preformatted }}
color={"secondary"}
paragraph={false}

@ -157,7 +157,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
d += "&nbsp;&nbsp;&nbsp;&nbsp;[\n";
d += n
.map(
(line: number[]) => "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" +
(line: number[]) =>
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" +
line.map((x: number) => `${x}`.padStart(2, " ")).join(",") +
"]",
)

@ -9,20 +9,21 @@ interface IProps {
onClose: () => void;
onConfirm: () => void;
confirmationText: string;
}
}
export function ConfirmationModal(props: IProps): React.ReactElement {
export function ConfirmationModal(props: IProps): React.ReactElement {
return (
<Modal open={props.open} onClose={props.onClose}>
<>
<Typography>
{props.confirmationText}
</Typography>
<Button onClick={() => {
<Typography>{props.confirmationText}</Typography>
<Button
onClick={() => {
props.onConfirm();
}}>Confirm</Button>
}}
>
Confirm
</Button>
</>
</Modal>
);
}
}

@ -5,7 +5,7 @@
import React from "react";
import { Button, ButtonProps } from "@mui/material";
import makeStyles from '@mui/styles/makeStyles';
import makeStyles from "@mui/styles/makeStyles";
const useStyles = makeStyles({
// Tries to emulate StdButton in buttons.scss
root: {

@ -6,7 +6,7 @@
import React from "react";
import { Paper, PaperProps } from "@mui/material";
import makeStyles from '@mui/styles/makeStyles';
import makeStyles from "@mui/styles/makeStyles";
const useStyles = makeStyles({
root: {

@ -6,7 +6,7 @@
import React from "react";
import { TextField, TextFieldProps } from "@mui/material";
import makeStyles from '@mui/styles/makeStyles';
import makeStyles from "@mui/styles/makeStyles";
const backgroundColorStyles = {
backgroundColor: "rgba(57, 54, 54, 0.9)",

@ -26,7 +26,7 @@ export function Overview({ children }: IProps): React.ReactElement {
if (router.page() === Page.BitVerse || router.page() === Page.HackingMission || router.page() === Page.Loading)
return <></>;
let icon;
if (open){
if (open) {
icon = <VisibilityOffIcon color="primary" />;
} else {
icon = <VisibilityIcon color="primary" />;

@ -45,7 +45,14 @@ export function StdButton(props: IStdButtonProps): React.ReactElement {
}
return (
<button className={className} id={props.id} onClick={props.onClick} onKeyUp={props.onKeyUp} style={props.style} autoFocus={props.autoFocus}>
<button
className={className}
id={props.id}
onClick={props.onClick}
onKeyUp={props.onKeyUp}
style={props.style}
autoFocus={props.autoFocus}
>
{props.text}
{hasTooltip && tooltip}
</button>

@ -51,11 +51,7 @@ function ColorEditor({ name }: { name: string }): React.ReactElement {
InputProps={{
startAdornment: (
<>
<ColorPicker
hideTextfield
value={color}
onChange={onColorPickerChange}
/>
<ColorPicker hideTextfield value={color} onChange={onColorPickerChange} />
</>
),
endAdornment: (

@ -22,9 +22,9 @@ export function createStatusText(text: string): void {
// Likely not needed due to clearTimeout, but just in case...
x = undefined;
// reset the element's animation
statusElement.style.animation = 'none';
setTimeout(function() {
statusElement.style.animation = '';
statusElement.style.animation = "none";
setTimeout(function () {
statusElement.style.animation = "";
}, 10);
}