add hoop before exposing

This commit is contained in:
omuretsu 2022-10-11 21:02:04 -04:00
parent 7d07f44b3e
commit 41b6f0b87b
3 changed files with 8 additions and 7 deletions

@ -546,6 +546,7 @@ export const RamCosts: RamCostTree<Omit<NSFull, "args" | "enums">> = {
// Easter egg function
break: 0,
},
iKnowWhatImDoing: 0,
formulas: {
mockServer: 0,

@ -4,6 +4,7 @@ import * as bcrypt from "bcryptjs";
import { Apr1Events as devMenu } from "../ui/Apr1";
import { InternalAPI, NetscriptContext } from "../Netscript/APIWrapper";
import { helpers } from "../Netscript/NetscriptHelpers";
import { Terminal } from "../Terminal";
export interface INetscriptExtra {
heart: {
@ -14,6 +15,7 @@ export interface INetscriptExtra {
bypass(doc: Document): void;
alterReality(): void;
rainbow(guess: string): void;
iKnowWhatImDoing(): void;
}
export function NetscriptExtra(): InternalAPI<INetscriptExtra> {
@ -75,5 +77,10 @@ export function NetscriptExtra(): InternalAPI<INetscriptExtra> {
}
return tryGuess();
},
iKnowWhatImDoing: (ctx) => () => {
helpers.log(ctx, () => "Unlocking unsupported feature: window.tprintRaw");
// @ts-ignore window has no tprintRaw property defined
window.tprintRaw = Terminal.printRaw.bind(Terminal);
},
};
}

@ -1,9 +1,2 @@
import { Terminal as TTerminal } from "./Terminal/Terminal";
import { ReactNode } from "react";
declare global {
interface Window {
tprintRaw: (node: ReactNode) => void;
}
}
export const Terminal = new TTerminal();
window["tprintRaw"] = Terminal.printRaw.bind(Terminal);