Merge pull request #3618 from Hoekstraa/clearTerminal

API: Terminal screen can now be cleared from within scripts with ns.ui.clearTerminal()
This commit is contained in:
hydroflame
2022-05-13 11:07:25 -04:00
committed by GitHub
3 changed files with 16 additions and 0 deletions
+7
View File
@@ -14,6 +14,7 @@ import { defaultTheme } from "../Themes/Themes";
import { defaultStyles } from "../Themes/Styles";
import { CONSTANTS } from "../Constants";
import { hash } from "../hash/hash";
import { Terminal } from "../../src/Terminal";
export function NetscriptUserInterface(
player: IPlayer,
@@ -108,5 +109,11 @@ export function NetscriptUserInterface(
return gameInfo;
},
clearTerminal: function (): void {
updateRam("clearTerminal");
workerScript.log("ui.clearTerminal", () => `Clearing terminal`);
Terminal.clear();
},
};
}