stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

7h 6m 57s logged

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") and PropUI("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. Prop in a hook just returns the fallback
  • saved as scriptProperties in scene JSON, omitted when empty
  • property edits support undo, including live number/string editing. unused saved properties can be pruned with undo too..
  • ScriptSlot is 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 a uuid field. null reparents an element to the root
  • UISystem::Reparent preserves ownership and prevents parenting an element under its own descendant
  • new created scripts use fn on_update(dt) (I wrote on_update() last time …oops…)

smaller stuff

  • UndoManager::Execute returns 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!!! :yay:

1
40

Comments 0

No comments yet. Be the first!