Initial commit

moved from private version control
This commit is contained in:
2025-10-19 21:12:41 +11:00
parent 5e84773bbe
commit e64f3e881e
187 changed files with 25372 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import { createNodeModule } from "../../nodeTypes.js";
/**
* Removes a table entry at a given index using PICO-8's deli helper.
*/
export const tableDeliNode = createNodeModule(
{
id: "table_deli",
title: "Delete Table Index",
category: "Tables",
description: "Remove and return the value at an index, or the last entry when omitted.",
searchTags: ["deli", "table", "remove", "pop"],
inputs: [
{ id: "exec_in", name: "Exec", direction: "input", kind: "exec" },
{ id: "table", name: "Table", direction: "input", kind: "table" },
{
id: "index",
name: "Index",
direction: "input",
kind: "number",
description: "Optional index to remove",
},
],
outputs: [
{ id: "exec_out", name: "Exec", direction: "output", kind: "exec" },
],
properties: [],
},
{
emitExec: ({ indent, indentLevel, resolveValueInput, emitNextExec }) => {
const OMIT = "__pg_omit__";
const tableValue = resolveValueInput("table", "{}");
const index = resolveValueInput("index", OMIT);
const args = [tableValue];
if (index !== OMIT) {
args.push(index);
}
const line = `${indent(indentLevel)}deli(${args.join(", ")})`;
return [line, ...emitNextExec("exec_out")];
},
}
);