mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 10:46:06 +10:00
Add initial Pico-8 cartridges for testing
- Created test_cart.p8 with basic drawing functionality and a print statement. - Created test_unix.p8 with a simple initialization function.
This commit is contained in:
38
scripts/core/lua/LuaLiteralString.js
Normal file
38
scripts/core/lua/LuaLiteralString.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @typedef {import('./LuaLiteralTypes.js').LuaLiteralHandler} LuaLiteralHandler
|
||||
*/
|
||||
|
||||
/** @type {LuaLiteralHandler} */
|
||||
export const LuaLiteralString = {
|
||||
/**
|
||||
* @param {unknown} value
|
||||
* @returns {string}
|
||||
*/
|
||||
format(value) {
|
||||
return JSON.stringify(String(value ?? ""));
|
||||
},
|
||||
|
||||
/** @returns {string} */
|
||||
defaultLiteral() {
|
||||
return '""';
|
||||
},
|
||||
|
||||
spawnableByDefault: true,
|
||||
|
||||
nodeModule: {
|
||||
definition: {
|
||||
id: "string_literal",
|
||||
title: "String",
|
||||
category: "Values",
|
||||
description: "Constant string literal.",
|
||||
searchTags: ["string", "literal", "text", "value"],
|
||||
inputs: [],
|
||||
outputs: [{ id: "value", name: "Value", direction: "output", kind: "string" }],
|
||||
properties: [{ key: "value", label: "Text", type: "string", defaultValue: "hello" }],
|
||||
},
|
||||
behavior: {
|
||||
evaluateValue: ({ node, formatLiteral }) =>
|
||||
formatLiteral("string", node.properties.value ?? ""),
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user