Add UI to script node

This commit is contained in:
Skyler Lehmkuhl
2026-02-19 10:16:05 -05:00
parent 2804c2bd5d
commit 92dffbaa4e
11 changed files with 819 additions and 11 deletions
+4 -2
View File
@@ -15,7 +15,7 @@ use parser::Parser;
pub use error::ScriptError;
pub use ui_decl::{UiDeclaration, UiElement};
pub use vm::{ScriptVM, SampleSlot};
pub use vm::{ScriptVM, SampleSlot, DrawVM, DrawCommand, MouseState};
/// Compiled script metadata — everything needed to create a ScriptNode
pub struct CompiledScript {
@@ -28,6 +28,7 @@ pub struct CompiledScript {
pub sample_slots: Vec<String>,
pub ui_declaration: UiDeclaration,
pub source: String,
pub draw_vm: Option<DrawVM>,
}
#[derive(Debug, Clone)]
@@ -55,7 +56,7 @@ pub fn compile(source: &str) -> Result<CompiledScript, CompileError> {
let validated = validator::validate(&script)?;
let (vm, ui_decl) = codegen::compile(&validated)?;
let (vm, ui_decl, draw_vm) = codegen::compile(&validated)?;
let input_ports = script
.inputs
@@ -104,5 +105,6 @@ pub fn compile(source: &str) -> Result<CompiledScript, CompileError> {
sample_slots,
ui_declaration: ui_decl,
source: source.to_string(),
draw_vm,
})
}