module

MJ::SceneLibrary

Scene library: diorama compositions saved as <name>.json under Config.scenes_dir. A scene is a self-describing JSON document (the editor's export shape), so — unlike the prop library — it needs no folder-per-item and no separate manifest; a listing just scans the directory. Same relocatable pattern as the prop/backdrop libraries, so it maps onto a future TransFS/DataDungeon backend.

Class methods

delete(name : String) : Bool
Source
list

Lightweight listing: {name, layers, updated} per scene, sorted by name.

Source
path_for(name : String) : String
Source
read(name : String) : String | Nil
Source
root
Source
safe_name(name : String) : String

A filesystem-safe scene name: basename only (no dir), drop a trailing .json, and keep just portable characters — so a crafted name can never escape the library root.

Source
save(name : String, body : String) : String

Validate that body is a scene (parses and carries a layers array), then write it. Returns the safe name it was stored under. Raises on invalid JSON or a missing layers array.

Source