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:
David Walker
2023-01-05 17:30:34 -08:00
committed by GitHub
parent c42fde9379
commit 7b5080a42b
7 changed files with 23 additions and 11 deletions
+2 -3
View File
@@ -385,9 +385,8 @@ function LogWindow(props: IProps): React.ReactElement {
>
<div style={{ display: "flex", flexDirection: "column" }}>
{script.logs.map(
(line: string, i: number): JSX.Element => (
<ANSIITypography key={i} text={line} color={lineColor(line)} />
),
(line: React.ReactNode, i: number): React.ReactNode =>
typeof line !== "string" ? line : <ANSIITypography key={i} text={line} color={lineColor(line)} />,
)}
</div>
</Paper>