Put a loading screen around the browse neighbourhood screen, useful when more expensive neighbourhood style is chosen
@@ -165,7 +165,13 @@ impl State<App> for BrowseNeighbourhoods {
fn make_world(ctx: &mut EventCtx, app: &App) -> World<NeighbourhoodID> {
let mut world = World::bounded(app.map.get_bounds());
let map = &app.map;
+ ctx.loading_screen("render neighbourhoods", |ctx, timer| {
+ timer.start_iter(
+ "render neighbourhoods",
+ app.session.partitioning.all_neighbourhoods().len(),
+ );
for (id, info) in app.session.partitioning.all_neighbourhoods() {
+ timer.next();
match app.session.draw_neighbourhood_style {
Style::Simple => {
world
@@ -181,8 +187,6 @@ fn make_world(ctx: &mut EventCtx, app: &App) -> World<NeighbourhoodID> {
.build(ctx);
}
Style::Cells => {
- // TODO The cell colors are confusing alongside the other neighbourhood colors. I
- // tried greying out everything else, but then the view is too jumpy.
let neighbourhood = Neighbourhood::new(ctx, app, *id);
let render_cells = crate::draw_cells::RenderCells::new(map, &neighbourhood);
let hovered_batch = render_cells.draw_colored_areas();
@@ -225,6 +229,7 @@ fn make_world(ctx: &mut EventCtx, app: &App) -> World<NeighbourhoodID> {
}
}
}
+ });
world
}
