mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
NETSCRIPT: Add undocumented function printRaw() (#277)
This is analagous to tprintRaw (enabled by ns.iKnowWhatImDoing()), but for logs instead of the terminal. This provides a supported* method of creating complicated UIs for scripts. *No actual support, expressed or implied, is provided for use of this function.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type React from "react";
|
||||
import { Player } from "../Player";
|
||||
import { Exploit } from "../Exploits/Exploit";
|
||||
import * as bcrypt from "bcryptjs";
|
||||
@@ -16,6 +17,7 @@ export interface INetscriptExtra {
|
||||
alterReality(): void;
|
||||
rainbow(guess: string): void;
|
||||
iKnowWhatImDoing(): void;
|
||||
printRaw(value: React.ReactNode): void;
|
||||
}
|
||||
|
||||
export function NetscriptExtra(): InternalAPI<INetscriptExtra> {
|
||||
@@ -82,5 +84,9 @@ export function NetscriptExtra(): InternalAPI<INetscriptExtra> {
|
||||
// @ts-ignore window has no tprintRaw property defined
|
||||
window.tprintRaw = Terminal.printRaw.bind(Terminal);
|
||||
},
|
||||
printRaw: (ctx) => (value) => {
|
||||
// Using this voids the warranty on your tail log
|
||||
ctx.workerScript.print(value as React.ReactNode);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user