From f8c7ed5ea8a19d7bd19fffcdcc555ae23ca1ffde Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 9 Jan 2019 12:37:41 -0800 Subject: [PATCH] woops, turn cycler assumed everything's a traffic signal --- editor/src/plugins/view/turn_cycler.rs | 30 +++++++++++++------------- ezgui/src/text.rs | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/editor/src/plugins/view/turn_cycler.rs b/editor/src/plugins/view/turn_cycler.rs index 530888056f..76a92e72e5 100644 --- a/editor/src/plugins/view/turn_cycler.rs +++ b/editor/src/plugins/view/turn_cycler.rs @@ -68,22 +68,22 @@ impl Plugin for TurnCyclerState { } } TurnCyclerState::ShowIntersection(i) => { - let (cycle, mut time_left) = ctx - .map - .get_traffic_signal(*i) - .current_cycle_and_remaining_time(ctx.sim.time.as_time()); - if ctx.sim.is_in_overtime(*i) { - // TODO Hacky way of indicating overtime. Should make a 3-case enum. - time_left = -1.0 * si::S; + if let Some(signal) = ctx.map.maybe_get_traffic_signal(*i) { + let (cycle, mut time_left) = + signal.current_cycle_and_remaining_time(ctx.sim.time.as_time()); + if ctx.sim.is_in_overtime(*i) { + // TODO Hacky way of indicating overtime. Should make a 3-case enum. + time_left = -1.0 * si::S; + } + draw_signal_diagram( + *i, + cycle.idx, + Some(time_left), + TOP_MENU_HEIGHT + 10.0, + g, + ctx, + ); } - draw_signal_diagram( - *i, - cycle.idx, - Some(time_left), - TOP_MENU_HEIGHT + 10.0, - g, - ctx, - ); } } } diff --git a/ezgui/src/text.rs b/ezgui/src/text.rs index 7eacae490d..d82b314f65 100644 --- a/ezgui/src/text.rs +++ b/ezgui/src/text.rs @@ -14,7 +14,7 @@ pub const BG_COLOR: Color = Color::grey(0.2); pub const PROMPT_COLOR: Color = Color::BLUE; pub const SELECTED_COLOR: Color = Color::RED; pub const HOTKEY_COLOR: Color = Color::GREEN; -pub const INACTIVE_CHOICE_COLOR: Color = Color::grey(0.8); +pub const INACTIVE_CHOICE_COLOR: Color = Color::grey(0.4); const FONT_SIZE: u32 = 24; // TODO These are dependent on FONT_SIZE, but hand-tuned. Glyphs all have 0 as their height, and