Merge pull request #1473 from danielyxie/dev

Added alert function
This commit is contained in:
hydroflame 2021-10-12 20:22:21 -04:00 committed by GitHub
commit 59b10c1b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -146,6 +146,7 @@ import { INetscriptGang, NetscriptGang } from "./NetscriptFunctions/Gang";
import { INetscriptSleeve, NetscriptSleeve } from "./NetscriptFunctions/Sleeve";
import { INetscriptExtra, NetscriptExtra } from "./NetscriptFunctions/Extra";
import { INetscriptHacknet, NetscriptHacknet } from "./NetscriptFunctions/Hacknet";
import { dialogBoxCreate } from "./ui/React/DialogBox";
const defaultInterpreter = new Interpreter("", () => undefined);
@ -2679,6 +2680,9 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
updateDynamicRam("getTimeSinceLastAug", getRamCost("getTimeSinceLastAug"));
return Player.playtimeSinceLastAug;
},
alert: function (message: any): void {
dialogBoxCreate(message);
},
prompt: function (txt: any): any {
if (!isString(txt)) {
txt = JSON.stringify(txt);