diff --git a/map_editor/assets/ui/hide.png b/map_editor/assets/ui/hide.png deleted file mode 100644 index 2f0b81a80c..0000000000 Binary files a/map_editor/assets/ui/hide.png and /dev/null differ diff --git a/map_editor/assets/ui/show.png b/map_editor/assets/ui/show.png deleted file mode 100644 index 004d671460..0000000000 Binary files a/map_editor/assets/ui/show.png and /dev/null differ diff --git a/map_editor/src/main.rs b/map_editor/src/main.rs index 6ea917ceea..f21c59d44f 100644 --- a/map_editor/src/main.rs +++ b/map_editor/src/main.rs @@ -69,7 +69,6 @@ impl UI { } else { Model::blank() }; - ctx.set_textures(Vec::new(), &mut Timer::throwaway()); ctx.canvas.load_camera_state(&model.map.name); let bounds = model.map.gps_bounds.to_bounds(); ctx.canvas.map_dims = (bounds.width(), bounds.height()); @@ -94,11 +93,11 @@ impl UI { last_id: None, }; - ui.recount_parking_tags(); + ui.recount_parking_tags(ctx); ui } - fn recount_parking_tags(&mut self) { + fn recount_parking_tags(&mut self, ctx: &EventCtx) { let mut ways_audited = HashSet::new(); let mut ways_missing = HashSet::new(); for r in self.model.map.roads.values() { @@ -111,11 +110,14 @@ impl UI { ways_audited.insert(r.osm_tags[osm::OSM_WAY_ID].clone()); } } - self.menu.set_info(Text::from(Line(format!( - "Parking data audited: {} / {} ways", - abstutil::prettyprint_usize(ways_audited.len()), - abstutil::prettyprint_usize(ways_audited.len() + ways_missing.len()) - )))); + self.menu.set_info( + ctx, + Text::from(Line(format!( + "Parking data audited: {} / {} ways", + abstutil::prettyprint_usize(ways_audited.len()), + abstutil::prettyprint_usize(ways_audited.len() + ways_missing.len()) + ))), + ); } } @@ -211,7 +213,7 @@ impl GUI for UI { } else if ctx.input.key_pressed(Key::T, "toggle parking") { self.model.toggle_r_parking(r, ctx.prerender); self.model.world.handle_mouseover(ctx); - self.recount_parking_tags(); + self.recount_parking_tags(ctx); } else if ctx.input.key_pressed(Key::F, "toggle sidewalks") { self.model.toggle_r_sidewalks(r, ctx.prerender); self.model.world.handle_mouseover(ctx); @@ -313,17 +315,20 @@ impl GUI for UI { } else if short_roads.is_empty() && self .menu - .swap_action("find short roads", "clear short roads") + .swap_action(ctx, "find short roads", "clear short roads") { *short_roads = find_short_roads(&self.model); if short_roads.is_empty() { - self.menu - .change_action("clear short roads", "find short roads"); + self.menu.change_action( + ctx, + "clear short roads", + "find short roads", + ); } } else if !short_roads.is_empty() && self .menu - .swap_action("clear short roads", "find short roads") + .swap_action(ctx, "clear short roads", "find short roads") { short_roads.clear(); } @@ -643,7 +648,7 @@ impl GUI for UI { if show_tooltip { // TODO Argh, covers up mouseover tooltip. if let Some(cursor) = g.canvas.get_cursor_in_map_space() { - g.draw_mouse_tooltip(&Text::from(Line(cursor.to_string())).with_bg()); + g.draw_mouse_tooltip(Text::from(Line(cursor.to_string())).with_bg()); } } } @@ -651,7 +656,7 @@ impl GUI for UI { self.menu.draw(g); g.draw_blocking_text( - &self.sidebar, + self.sidebar.clone(), ( ezgui::HorizontalAlignment::Left, ezgui::VerticalAlignment::Top, @@ -681,7 +686,9 @@ fn preview_intersection(i: OriginalIntersection, model: &Model, ctx: &EventCtx) let center = poly.center(); batch.push(Color::RED.alpha(0.5), poly); batch.add_transformed( - Text::from(Line(label)).with_bg().render_to_batch(), + Text::from(Line(label)) + .with_bg() + .render_to_batch(ctx.prerender), center, 0.1, Angle::ZERO, diff --git a/map_editor/src/world.rs b/map_editor/src/world.rs index 0daac5e5fe..5f559ab76d 100644 --- a/map_editor/src/world.rs +++ b/map_editor/src/world.rs @@ -1,5 +1,5 @@ use aabb_quadtree::{ItemId, QuadTree}; -use ezgui::{Color, Drawable, EventCtx, GeomBatch, GfxCtx, Prerender, Text}; +use ezgui::{Color, Drawable, EventCtx, GeomBatch, GfxCtx, Prerender}; use geom::{Bounds, Circle, Distance, Polygon, Pt2D}; use std::collections::HashMap; use std::fmt::Debug; @@ -13,8 +13,6 @@ pub trait ObjectID: Clone + Copy + Debug + Eq + Hash { pub struct Object { id: ID, geometry: Vec<(Color, Polygon)>, - // TODO Unused - label: Option, } impl Object { @@ -22,7 +20,6 @@ impl Object { Object { id, geometry: vec![(color, poly)], - label: None, } } @@ -30,7 +27,6 @@ impl Object { Object { id, geometry: Vec::new(), - label: None, } } @@ -46,7 +42,6 @@ impl Object { struct WorldObject { unioned_polygon: Polygon, draw: Drawable, - label: Option, quadtree_id: ItemId, } @@ -86,9 +81,6 @@ impl World { for id in objects { let obj = &self.objects[&id]; g.redraw(&obj.draw); - if let Some(ref txt) = obj.label { - g.draw_text_at(txt, obj.unioned_polygon.center()); - } } if let Some(id) = self.current_selection { @@ -156,7 +148,6 @@ impl World { unioned_polygon, draw, quadtree_id, - label: obj.label, }, ); }