script properties & UUID types
scripts can now declare properties that show up in the inspector and get saved per entity. also ripped std::string UUIDs out of most of the engine in favor of an actual Core::UUID type, plus some scripting additions and a few tests.
changes
script properties
-
Prop("SpeedOrSomething", 2.5),PropEntity("TargetEntity")andPropUI("MyRect")for regular values, entities and UI elements - properties show up under each script slot in the inspector, with appropriate controls and per-slot values
- values are only readable during top-level script execution, so store them in variables for use in hooks.
Propin a hook just returns the fallback - saved as
scriptPropertiesin scene JSON, omitted when empty - property edits support undo, including live number/string editing. unused saved properties can be pruned with undo too..
-
ScriptSlotis move-only now
Core::UUID
- replaced string UUIDs across the registry, UI, editor commands, project config, save directories and scripting with a 16-byte
Core::UUID - registry UUID lookups now use an index instead of looping through entities
- malformed UUIDs in files fall back to generated or nil UUIDs
- UI UUIDs are saved and restored, including nested elements. duplicate UI UUIDs are handled without crashing the loader
- savegame directories etc take a UUID directly
scripting & UI
- script objects now have identity values and wrappers are
readonly, along with various scripting result objects. came with an ObSL bump - UI wrappers get
SetParent(parent)and auuidfield.nullreparents an element to the root -
UISystem::Reparentpreserves ownership and prevents parenting an element under its own descendant - new created scripts use
fn on_update(dt)(I wroteon_update()last time …oops…)
smaller stuff
-
UndoManager::Executereturns whether the command applied - script list shows filenames with Remove beside them
tests and docs
more tests and docs updated ofc…
so u can reference entities in scripts without using Find() now!!! 