API: Add API to minimize and expand tail windows (#2556)

This commit is contained in:
catloversg
2026-03-09 04:00:06 +07:00
committed by GitHub
parent 342dea77fa
commit 9eb2863e48
11 changed files with 175 additions and 12 deletions

View File

@@ -105,6 +105,19 @@ export function NetscriptUserInterface(): InternalAPI<IUserInterface> {
else runningScriptObj.tailProps?.setFontSize(helpers.number(ctx, "pixel", _pixel));
},
setTailMinimized:
(ctx) =>
(_minimized, _pid = ctx.workerScript.scriptRef.pid) => {
const minimized = helpers.boolean(ctx, "minimized", _minimized);
const pid = helpers.number(ctx, "pid", _pid);
const runningScriptObj = helpers.getRunningScript(ctx, pid);
if (runningScriptObj == null) {
helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(pid));
return;
}
runningScriptObj.tailProps?.setMinimized(minimized);
},
windowSize: () => () => {
return [window.innerWidth, window.innerHeight];
},