API: Add ns.renderTail (#1815)

This commit is contained in:
catloversg
2025-01-26 00:14:45 +07:00
committed by GitHub
parent 97d248419d
commit b161142796
5 changed files with 56 additions and 0 deletions
+11
View File
@@ -566,6 +566,17 @@ export const ns: InternalAPI<NSFull> = {
LogBoxEvents.emit(runningScriptObj);
},
renderTail:
(ctx) =>
(_pid = ctx.workerScript.scriptRef.pid) => {
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?.rerender();
},
moveTail:
(ctx) =>
(_x, _y, _pid = ctx.workerScript.scriptRef.pid) => {