dont show shared sidewalk corner icons at all in the editor

This commit is contained in:
Dustin Carlino 2018-12-04 12:37:44 -08:00
parent 16a4607aca
commit 4851761fc6
4 changed files with 15 additions and 1 deletions

View File

@ -105,6 +105,7 @@ pub struct RenderingHints {
// Miscellaneous cases where a plugin needs to control rendering.
pub suppress_traffic_signal_icon: Option<IntersectionID>,
pub hide_crosswalks: HashSet<TurnID>,
pub hide_turn_icons: HashSet<TurnID>,
}
// For plugins and rendering. Not sure what module this should live in, here seems fine.

View File

@ -1,7 +1,7 @@
use dimensioned::si;
use ezgui::{Color, GfxCtx, Text, Wizard};
use geom::{Bounds, Polygon, Pt2D};
use map_model::{IntersectionID, TurnID, TurnPriority};
use map_model::{IntersectionID, TurnID, TurnPriority, TurnType};
use objects::{Ctx, ID};
use piston::input::Key;
use plugins::{Plugin, PluginCtx};
@ -73,6 +73,13 @@ impl Plugin for TrafficSignalEditor {
ctx.primary.map.get_traffic_signal(*i).cycles[*current_cycle]
.get_absent_crosswalks(ctx.primary.map.get_turns_in_intersection(*i)),
);
for t in ctx.primary.map.get_turns_in_intersection(*i) {
// TODO bit weird, now looks like there's missing space between some icons. Do
// we ever need to have an icon for SharedSidewalkCorner?
if t.turn_type == TurnType::SharedSidewalkCorner {
ctx.hints.hide_turn_icons.insert(t.id);
}
}
if cycle_duration_wizard.is_some() {
if let Some(new_duration) = cycle_duration_wizard

View File

@ -62,6 +62,11 @@ impl Renderable for DrawTurn {
}
fn draw(&self, g: &mut GfxCtx, opts: RenderOptions, ctx: Ctx) {
// Some plugins hide icons entirely.
if ctx.hints.hide_turn_icons.contains(&self.id) {
return;
}
g.draw_circle(
ctx.cs.get("turn icon circle", Color::grey(0.3)),
&self.icon_circle,

View File

@ -345,6 +345,7 @@ impl UI {
osd: Text::new(),
suppress_traffic_signal_icon: None,
hide_crosswalks: HashSet::new(),
hide_turn_icons: HashSet::new(),
};
// First update the camera and handle zoom