Added alert function

This commit is contained in:
Olivier Gagnon 2021-10-12 20:02:37 -04:00
parent 6543e73f6f
commit 0dbeac52ac
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);