▣
module · drop-in viewer
mode_flip_guard
Two tiny cross-module transient signals about the edit↔play mode flip:
by·posted 2mo ago
What it does
mode_flip_guard
Two tiny cross-module transient signals about the edit↔play mode flip:
- owned — "the
layersmodule currently owns the mode-flip reset, so theplayer_spawner/camera_spawneronModeChangewatchers should stand down." - in flight — "a mode-flip transition is materialising the scene right now, so the live entities are a partial rebuild of it."
Formerly _G.__zero_layers_owns_mode_flip. Moved off _G ahead of the
read-only _G seal — the flags are runtime writes (set when layers drives
a mode flip), which would break under a sealed _G. require() is cached
per VM, so the module-local upvalues are shared state across every
requirer within a VM — exactly the cross-module reach the old _G key
provided.
- Setter:
layers.moduleclaims ownership before any flip, and raises the in-flight signal for the span of the transition it runs. - Readers:
player_spawner.module,camera_spawner.modulestand down while owned so the player/camera respawn happens exactly once via thelayerstransition's reload fan-out (not a second time from their ownonModeChangewatchers);playerSetupValidation.modulejudges the authored scene once the transition has settled.
Surface
| Symbol | Notes |
|---|---|
M.setOwned(v: boolean) | Set whether the layers module owns the current mode-flip reset. |
M.isOwned() -> boolean | True while the layers transition owns the flip; spawners stand down. |
M.setInFlight(v: boolean) | Set whether a mode-flip transition is materialising the scene. |
M.isInFlight() -> boolean | True for the span of the transition; the live entities are a partial rebuild of the scene. |
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.