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; return Player.playtimeSinceLastAug;
}, },
alert: function (message: any): void { alert: function (message: any): void {
message = toNative(message); message = argsToString([message]);
dialogBoxCreate(JSON.stringify(message)); dialogBoxCreate(message);
}, },
toast: function (message: any, variant: any = "success"): void { toast: function (message: any, variant: any = "success"): void {
if (!["success", "info", "warning", "error"].includes(variant)) if (!["success", "info", "warning", "error"].includes(variant))
throw new Error(`variant must be one of "success", "info", "warning", or "error"`); throw new Error(`variant must be one of "success", "info", "warning", or "error"`);
message = toNative(message); message = argsToString([message]);
SnackbarEvents.emit(JSON.stringify(message), variant); SnackbarEvents.emit(message, variant);
}, },
prompt: function (txt: any): any { prompt: function (txt: any): any {
if (!isString(txt)) { if (!isString(txt)) {