Skip to content

Commit 1f4f204

Browse files
gajopclaude
andcommitted
Rescan archives in available_maps via the new ScanAllDirs binding
The engine now ships the ScanAllDirs VFS binding, so call vfs().scan_all_dirs() before listing maps: a map the editor just exported becomes selectable in New Project without an editor restart, matching Chili. Verified at runtime — the scanner runs and New Project opens with no crash. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b1efdbb commit 1f4f204

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

native/src/sbc/actions/project.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ pub fn commit_new_project(
6767
/// Maps the VFS has an archive for, for the New Project dialog dropdown.
6868
pub fn available_maps(interface: &NativeInterfaceRef) -> Vec<String> {
6969
let vfs = interface.vfs();
70-
// TODO(engine-rebuild): rescan first so a just-exported map appears without a
71-
// restart (Chili does `VFS.ScanAllDirs()` here). The `scan_all_dirs` binding
72-
// now exists in the engine source, but calling it against an engine binary
73-
// that predates it reads past `VFS_API` and crashes. Re-enable once the
74-
// engine is rebuilt with the ScanAllDirs binding:
75-
// let _ = vfs.scan_all_dirs();
70+
// Rescan first, so a map the editor just exported becomes visible without a
71+
// restart (as Chili does with `VFS.ScanAllDirs()` before listing). Picks up
72+
// added archives; a deleted one lingers until restart (engine scanner quirk).
73+
let _ = vfs.scan_all_dirs();
7674
let mut maps = vfs.get_maps().unwrap_or_default();
7775
maps.sort();
7876
maps.into_iter()

0 commit comments

Comments
 (0)