From 988a602342d710538f02012499fd0a27070e6c10 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 26 May 2022 13:01:21 +0100 Subject: [PATCH] Hide some details from the zoomed view in the LTN tool: driveways, crossings, stop signs. Most are flat-out incorrect, especially in the UK. --- apps/ltn/src/lib.rs | 8 ++++++++ map_gui/src/options.rs | 6 ++++++ map_gui/src/render/intersection.rs | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/apps/ltn/src/lib.rs b/apps/ltn/src/lib.rs index d7095b0b36..4a49a83c29 100644 --- a/apps/ltn/src/lib.rs +++ b/apps/ltn/src/lib.rs @@ -57,6 +57,14 @@ struct Args { fn run(mut settings: Settings) { let mut opts = map_gui::options::Options::load_or_default(); opts.color_scheme = map_gui::colors::ColorSchemeChoice::LTN; + opts.show_building_driveways = false; + // TODO Ideally we would have a better map model in the first place. The next best thing would + // be to change these settings based on the map's country, but that's a bit tricky to do early + // enough (before map_switched). So for now, assume primary use of this tool is in the UK, + // where these settings are most appropriate. + opts.show_stop_signs = false; + opts.show_crosswalks = false; + let args = Args::from_iter(abstutil::cli_args()); args.app_args.override_options(&mut opts); diff --git a/map_gui/src/options.rs b/map_gui/src/options.rs index e114400633..12e62d0dc2 100644 --- a/map_gui/src/options.rs +++ b/map_gui/src/options.rs @@ -34,6 +34,10 @@ pub struct Options { pub camera_angle: CameraAngle, /// Draw building driveways. pub show_building_driveways: bool, + /// Draw stop signs. + pub show_stop_signs: bool, + /// Draw crosswalks and unmarked crossings. + pub show_crosswalks: bool, /// When making a screen recording, enable this option to hide some UI elements pub minimal_controls: bool, @@ -79,6 +83,8 @@ impl Options { toggle_day_night_colors: false, camera_angle: CameraAngle::TopDown, show_building_driveways: true, + show_stop_signs: true, + show_crosswalks: true, time_increment: Duration::minutes(10), dont_draw_time_warp: false, diff --git a/map_gui/src/render/intersection.rs b/map_gui/src/render/intersection.rs index 0d51cc4e1c..a443558c5e 100644 --- a/map_gui/src/render/intersection.rs +++ b/map_gui/src/render/intersection.rs @@ -55,6 +55,9 @@ impl DrawIntersection { } for turn in &i.turns { + if !app.opts().show_crosswalks { + break; + } if turn.turn_type.pedestrian_crossing() { make_crosswalk(&mut default_geom, turn, map, app.cs()); } @@ -76,6 +79,9 @@ impl DrawIntersection { } IntersectionType::StopSign => { for ss in map.get_stop_sign(i.id).roads.values() { + if !app.opts().show_stop_signs { + break; + } if ss.must_stop { if let Some((octagon, pole, angle)) = DrawIntersection::stop_sign_geom(ss, map)