use crate::prelude::*;
pub struct TheNodeTerminal {
pub name: String,
pub category_name: String,
}
pub struct TheNode {
pub name: String,
pub status_text: Option<String>,
pub position: Vec2<i32>,
pub inputs: Vec<TheNodeTerminal>,
pub outputs: Vec<TheNodeTerminal>,
pub preview: TheRGBABuffer,
pub supports_preview: bool,
pub preview_is_open: bool,
pub can_be_deleted: bool,
}
pub struct TheNodeCanvas {
pub nodes: Vec<TheNode>,
pub node_width: i32,
pub connections: Vec<(u16, u8, u16, u8)>,
pub offset: Vec2<i32>,
pub selected_node: Option<usize>,
pub zoom: f32,
pub categories: FxHashMap<String, TheColor>,
}
impl Default for TheNodeCanvas {
fn default() -> Self {
Self::new()
}
}
impl TheNodeCanvas {
pub fn new() -> Self {
Self {
nodes: Vec::new(),
node_width: 128,
connections: Vec::new(),
offset: Vec2::zero(),
selected_node: None,
zoom: 1.0,
categories: FxHashMap::default(),
}
}
}