NETSCRIPT: Added changing tail font size through scripts (#1852)

This commit is contained in:
G4mingJon4s
2025-01-05 01:51:13 +01:00
committed by GitHub
parent 3db190c9a0
commit c622291eff
9 changed files with 97 additions and 1 deletions
+12
View File
@@ -616,6 +616,18 @@ export const ns: InternalAPI<NSFull> = {
runningScriptObj.title = typeof title === "string" ? title : wrapUserNode(title);
runningScriptObj.tailProps?.rerender();
},
setTailFontSize:
(ctx) =>
(_pixel, scriptID, hostname, ...scriptArgs) => {
const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);
const runningScriptObj = helpers.getRunningScript(ctx, ident);
if (runningScriptObj == null) {
helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));
return;
}
if (_pixel === undefined) runningScriptObj.tailProps?.setFontSize(undefined);
else runningScriptObj.tailProps?.setFontSize(helpers.number(ctx, "pixel", _pixel));
},
nuke: (ctx) => (_hostname) => {
const hostname = helpers.string(ctx, "hostname", _hostname);