woops, turn cycler assumed everything's a traffic signal

This commit is contained in:
Dustin Carlino 2019-01-09 12:37:41 -08:00
parent 37c9d01a6f
commit f8c7ed5ea8
2 changed files with 16 additions and 16 deletions

View File

@ -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,
);
}
}
}

View File

@ -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