builtin scripts

This commit is contained in:
2026-06-16 14:34:42 -05:00
parent 7608fc959f
commit 6464e47747
13 changed files with 317 additions and 119 deletions
+6
View File
@@ -51,6 +51,11 @@ pub struct ObjectDef {
/// Name of the Rhai script in [`Board::scripts`] that drives this object.
/// `None` means this object has no script yet.
pub script_name: Option<String>,
/// Embedded built-in script source, set when a script-backed archetype (e.g. a
/// `pusher_*`) is expanded into an object at load time (see
/// [`crate::builtin_scripts`]). Takes precedence over [`script_name`](ObjectDef::script_name)
/// and is not part of the map file (it is regenerated from the archetype on load).
pub builtin_script: Option<&'static str>,
/// Open-ended string labels for this object. Serialized as a TOML array;
/// not subject to any rate limit — mutations take effect immediately after
/// the frame's action queue is drained.
@@ -88,6 +93,7 @@ impl ObjectDef {
opaque: true,
pushable: false,
script_name: None,
builtin_script: None,
tags: HashSet::new(),
name: None,
}