uuid-bound script wrappers…, logger sinks…., and a pile of small editor stuff….
mostly scripting + logging plumbing this time, plus a couple of editor things I’d been wanting…
changes
script wrappers are uuid-bound now
entity wrappers used to capture the raw runtime id, which is a problem if ids get recycled or the registry gets rebuilt. now every wrapper holds the entity’s uuid and resolves the live id on each call, so it keeps pointing at the right entity (or does nothing if it’s gone).
- new
FindEntityByUUID(uuid)global andGetUUID()/.uuidon entity objects -
SetParentmatches an entity object by uuid, a plain number is still a runtime id - same treatment for UI wrappers: they resolve by uuid instead of name, so renaming or duplicate names don’t break them
- added
FindUIByUUID,GetUUID()andDestroy()on UI elements, andSetImage/GetImageon images (acquires the texture through the scene asset scope like fonts do) - still by name:
FindUI,DestroyUIand the button state queries (WasClicked/IsHovered/IsHeld). UI scripting is still weird… work in progress i guess…
logger sinks
the old way was swapping the logger’s std::ostream for a stringstream that the UI panel also read from, which was a data race waiting to happen (logger thread writes, main thread reads). replaced it with actual sinks:
-
ILogSinkwithConsoleSink(stdout/stderr like before) andUILogSink(mutex -ed pending buffer the panel drains each frame) - the editor and runtime both register a
ConsoleSink, and the editor adds the UI sink on top, so the Logs panel is always there now instead of only when there’s no tty - console panels color lines by severity now
- interpreter output goes through a small
UiStreamostream into the ObSL panel, with stdout and stderr split (needed the bumped obsl,Interpretertakes both streams now…) - ObSL panel clears when you enter play mode
editor
- F focuses the camera on the selected entity, press it again to go back to the origin. its smooth…., ..panning cancels the focus
- keyboard pan only gets called when there’s actually input now..
- editing a material in the inspector no longer mutates shared runtime-only materials. if it isn’t a catalog asset it gets cloned into
assets.jsonfirst, and edits to catalog materials get “upserted” back to the catalog. “Clone Material” writes to the catalog too - new scripts from the project browser come with an
on_updatestub instead of just a comment
scripting runtime
- script top-level code now runs with the command buffer in “immediate” mode (
BeginImmediate/EndImmediate), so registry writes at the top of a script apply right away instead of waiting for a flush that hasn’t been set up yet during init -
Hex_GetNeighborswasn’t GC protecting its array while filling it, fixed….
grid tile textures
a tile type with no texture used to fall back to hex_tex both when collecting dependencies and when loading scenes, which would pull in a texture that might not exist. now no texture means no texture… as it should…
misc
- bumped obsl (new
usingalias feature, and err output stream settings) - docs for all the uuid stuff, the F key, and the new UI/image methods… of course…
oh also … new demo scene testin thingamabob im messing with…
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.