Requests raised by the UI that need something draw doesn’t have access to (a live
&mut Renderer for loading assets, or EditorScene’s ability to replace its whole World
when a project is opened) — consumed by EditorScene::update right after draw runs, while
the renderer is still in scope for that frame.
Top menu bar (project New/Open/Save) + bottom assets panel (collapsible; import/preview
project assets) + left hierarchy panel (add/remove/rename/select entities) + right inspector
panel for the selected entity’s Transform and Renderable (attach/replace/remove),
editable live.
The selected entity’s camera lens, if it has one: a checkbox to attach/detach a
[CameraComponent] (mirrors draw_renderable_editor’s Remove button), then FOV/near/far
fields and an “Active Camera” checkbox once attached. No GPU-load UiRequests indirection is
needed here like draw_renderable_editor’s attach flow — requests is only used to flag
edited.
A small transient toast reporting the outcome of the last Export (see EditorScene’s
export_status), success or failure — mirrors draw_script_error_overlay’s shape, just
for one message instead of a list.
A model has no cheap thumbnail to render (that would need an offscreen 3D render pass per
asset), so its tile is a plain placeholder icon instead, sized to match a texture tile.
Mirrors draw_script_group’s shape: a project can hold several scene .ron files (see
Project::list_scenes), listed here with a way to create new ones from scratch (a scene, like
a script, has nothing to import from outside the project) and switch which one is currently
open for editing.
Tab strip for the project’s open scenes (EditorScene::open_scenes), one tab per scene kept
loaded in memory — clicking a tab switches to it instantly (no reload: unlike the old
single-scene behavior, an opened scene stays fully loaded until its tab is closed). Each tab’s
bool marks it dirty (unsaved edits — see EditorScene::OpenScene::dirty), shown as a
trailing * on its label. The close button (“x”) removes a tab (autosaving it first, handled
by EditorScene::close_scene_tab), except when it’s the only one open — closing while Playing
(if it’s the active tab) stops Play first, same as switching does, so no separate disabled
state is needed here.
One tile: a placeholder icon (see draw_model_tile’s doc comment — no cheap thumbnail for a
scene either), highlighted if it’s the scene currently open for editing and starred if it’s
the project’s start scene. Double-click switches to it (opening a new tab if it isn’t already
open — see EditorScene::switch_or_open_scene — or just activating its existing tab, no
reload, if it is); the context menu offers Rename (inline, like the Scripts section’s) and
“Set as Start Scene”. Renaming only touches the file on disk, ProjectManifest.start_scene,
and any open tab’s identity — unlike a ScriptAttachment path (structured ECS data
rename_script can fix up everywhere it’s referenced), a scene.change("path") call is a
free-text string literal inside .rhai source that can’t be auto-fixed, so a renamed scene’s
incoming scene.change(...) calls (if any) are left dangling and need updating by hand.
The selected entity’s stacked .rhai scripts: a reorderable/removable list of what’s
attached (execution order top-to-bottom), plus a picker to attach more from the project’s
scripts/ folder. Unlike draw_renderable_editor, attaching/detaching/reordering needs no
GPU load step, so this mutates world.scripts directly rather than going through
UiRequests (beyond flagging edited).
A small transient toast listing recent script compile/runtime errors (see
EditorScene’s script_errors), so a broken script fails loudly without a full log panel.
A script has no thumbnail either (see draw_model_tile’s doc comment for the same reasoning),
so its tile is a plain placeholder icon, sized to match a texture/model tile. Unlike the
other asset tiles, this one is interactive: click opens path in an external text editor
(see open_script_in_editor) and the right-click context menu offers Rename (inline, like
the Hierarchy panel’s entity rename) and a way to change the remembered editor.
One tile: the texture’s own thumbnail (loaded through egui’s own texture manager, and
cached in previews so it’s decoded from disk once rather than every frame) with the file
name below it.
Prompts for an executable via a native file picker and, if one is chosen, saves it as the
remembered editor (persisted next to the editor executable — see EditorSettings::save) so
future script clicks don’t need to ask again.