Merge pull request #2050 from MageKing17/patch-1

Update NetscriptFunctions.ts
This commit is contained in:
hydroflame 2021-12-19 22:32:02 -05:00 committed by GitHub
commit 7710ae5564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2131,15 +2131,15 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
return Player.playtimeSinceLastAug;
},
alert: function (message: any): void {
message = toNative(message);
dialogBoxCreate(JSON.stringify(message));
message = argsToString([message]);
dialogBoxCreate(message);
},
toast: function (message: any, variant: any = "success"): void {
if (!["success", "info", "warning", "error"].includes(variant))
throw new Error(`variant must be one of "success", "info", "warning", or "error"`);
message = toNative(message);
SnackbarEvents.emit(JSON.stringify(message), variant);
message = argsToString([message]);
SnackbarEvents.emit(message, variant);
},
prompt: function (txt: any): any {
if (!isString(txt)) {