mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
33
scripts/nodes/library/data/cartdata.js
Normal file
33
scripts/nodes/library/data/cartdata.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Opens persistent cartridge storage using cartdata.
|
||||
*/
|
||||
export const cartdataNode = createNodeModule(
|
||||
{
|
||||
id: "data_cartdata",
|
||||
title: "Cart Data Init",
|
||||
category: "Data",
|
||||
description: "Setup persistent storage for the cartridge using CARTDATA().",
|
||||
searchTags: ["cartdata", "save", "persistent", "data"],
|
||||
inputs: [
|
||||
{
|
||||
id: "id",
|
||||
name: "Identifier",
|
||||
direction: "input",
|
||||
kind: "string",
|
||||
defaultValue: "\"my_cart\"",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{ id: "loaded", name: "Loaded", direction: "output", kind: "boolean" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ resolveValueInput }) => {
|
||||
const id = resolveValueInput("id", '"pico_cart"');
|
||||
return `cartdata(${id})`;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user