mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Merge pull request #2050 from MageKing17/patch-1
Update NetscriptFunctions.ts
This commit is contained in:
commit
7710ae5564
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user