mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 18:56:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
26
scripts/nodes/library/system/reboot.js
Normal file
26
scripts/nodes/library/system/reboot.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Reboots PICO-8, returning to a fresh command prompt.
|
||||
*/
|
||||
export const rebootNode = createNodeModule(
|
||||
{
|
||||
id: "system_reboot",
|
||||
title: "Reboot",
|
||||
category: "System",
|
||||
description: "Reboot the virtual machine to begin a new project.",
|
||||
searchTags: ["reboot", "restart", "system", "cart"],
|
||||
inputs: [{ id: "exec_in", name: "Exec", direction: "input", kind: "exec" }],
|
||||
outputs: [
|
||||
{ id: "exec_out", name: "Exec", direction: "output", kind: "exec" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
emitExec: ({ indent, indentLevel, emitNextExec }) => {
|
||||
const lines = [`${indent(indentLevel)}reboot()`];
|
||||
lines.push(...emitNextExec("exec_out"));
|
||||
return lines;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user