few fixes

This commit is contained in:
Olivier Gagnon 2021-09-21 17:36:42 -04:00
parent 501ce70702
commit 9a6b185141
8 changed files with 71 additions and 92 deletions

52
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -62,6 +62,7 @@ export function ResearchPopup(props: IProps): React.ReactElement {
Research(props.industry, allResearch[i]); Research(props.industry, allResearch[i]);
} catch (err) { } catch (err) {
dialogBoxCreate(err + ""); dialogBoxCreate(err + "");
return;
} }
dialogBoxCreate( dialogBoxCreate(

@ -135,6 +135,7 @@ function evaluateVersionCompatibility(ver) {
} }
function loadGame(saveString) { function loadGame(saveString) {
if (!saveString) return false;
saveString = decodeURIComponent(escape(atob(saveString))); saveString = decodeURIComponent(escape(atob(saveString)));
const saveObj = JSON.parse(saveString, Reviver); const saveObj = JSON.parse(saveString, Reviver);

@ -31,13 +31,12 @@ export const TerminalHelpText: string[] = [
"nano [file] Text editor - Open up and edit a script or text file", "nano [file] Text editor - Open up and edit a script or text file",
"ps Display all scripts that are currently running", "ps Display all scripts that are currently running",
"rm [file] Delete a file from the server", "rm [file] Delete a file from the server",
"run [name] [-t] [n] [args...] Execute a program or script", "run [name] [-t n] [--tail] [args...] Execute a program or script",
"scan Prints all immediately-available network connections", "scan Prints all immediately-available network connections",
"scan-analyze [d] [-a] Prints info for all servers up to <i>d</i> nodes away", "scan-analyze [d] [-a] Prints info for all servers up to <i>d</i> nodes away",
"scp [file] [server] Copies a file to a destination server", "scp [file] [server] Copies a file to a destination server",
"sudov Shows whether you have root access on this computer", "sudov Shows whether you have root access on this computer",
"tail [script] [args...] Displays dynamic logs for the specified script", "tail [script] [args...] Displays dynamic logs for the specified script",
"theme [preset] | bg txt hlgt Change the color scheme of the UI",
"top Displays all running scripts and their RAM usage", "top Displays all running scripts and their RAM usage",
"unalias [alias name] Deletes the specified alias", "unalias [alias name] Deletes the specified alias",
"wget [url] [target file] Retrieves code/text from a web server", "wget [url] [target file] Retrieves code/text from a web server",
@ -268,7 +267,7 @@ export const HelpTexts: IMap<string[]> = {
lscpu: ["lscpu", " ", "Prints the number of CPU Cores the current server has"], lscpu: ["lscpu", " ", "Prints the number of CPU Cores the current server has"],
mem: [ mem: [
"mem [script name] [-t] [num threads]", "mem [script name] [-t num_threads]",
" ", " ",
"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print ", "Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print ",
"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then ", "the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then ",
@ -374,24 +373,6 @@ export const HelpTexts: IMap<string[]> = {
" ", " ",
"tail foo.script 10 50000", "tail foo.script 10 50000",
], ],
theme: [
"theme [preset] | [#background #text #highlight]",
" ",
"Change the color of the game's user interface",
" ",
"This command can be called with a preset theme. Currently, the supported presets are 'default', 'muted', and 'solarized'. ",
"However, you can also specify your own color scheme using hex values. To do so, you must specify three hex color values ",
"for the background color, the text color, and the highlight color. These hex values must be preceded by a pound sign (#) and ",
"must be either 3 or 6 digits. Example:",
" ",
"theme #ffffff #385 #235012",
" ",
"A color picker such as ",
"<a href='https://www.google.com/search?q=color+picker&oq=color+picker&aqs=chrome.0.0l6.951j0j1&sourceid=chrome&ie=UTF-8' target='_blank'>Google's</a> ",
"can be used to get your desired hex color values",
" ",
"Themes are not saved, so when the game is closed and then re-opened or reloaded then it will revert back to the default theme.",
],
top: [ top: [
"top", "top",
" ", " ",

@ -344,14 +344,10 @@ export class Terminal implements ITerminal {
case CodingContractResult.Failure: case CodingContractResult.Failure:
++contract.tries; ++contract.tries;
if (contract.tries >= contract.getMaxNumTries()) { if (contract.tries >= contract.getMaxNumTries()) {
this.print("Contract <p style='color:red;display:inline'>FAILED</p> - Contract is now self-destructing"); this.print("Contract FAILED - Contract is now self-destructing");
serv.removeContract(contract); serv.removeContract(contract);
} else { } else {
this.print( this.print(`Contract FAILED - ${contract.getMaxNumTries() - contract.tries} tries remaining`);
`Contract <p style='color:red;display:inline'>FAILED</p> - ${
contract.getMaxNumTries() - contract.tries
} tries remaining`,
);
} }
break; break;
case CodingContractResult.Cancelled: case CodingContractResult.Cancelled:

@ -535,7 +535,7 @@ export function InteractiveTutorialRoot(): React.ReactElement {
const content = contents[step]; const content = contents[step];
if (content === undefined) throw new Error("error in the tutorial"); if (content === undefined) throw new Error("error in the tutorial");
return ( return (
<Paper square sx={{ maxWidth: "35vh", p: 2 }}> <Paper square sx={{ maxWidth: "70vw", p: 2 }}>
{content.content} {content.content}
{step !== iTutorialSteps.TutorialPageInfo && ( {step !== iTutorialSteps.TutorialPageInfo && (
<> <>