mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
Disable the predict impact tab on maps without scenarios. #448
This commit is contained in:
parent
2c6f218b22
commit
e8018c93e6
@ -132,6 +132,17 @@ impl State<App> for ShowGaps {
|
||||
|
||||
fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
|
||||
let data = app.session.mode_shift.value().unwrap();
|
||||
|
||||
if data.all_candidate_trips.is_empty() {
|
||||
return Tab::PredictImpact.make_left_panel(
|
||||
ctx,
|
||||
app,
|
||||
Widget::col(vec![
|
||||
"This city doesn't have travel demand model data available".text_widget(ctx),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
let col = vec![
|
||||
// TODO Info button with popup explaining all the assumptions... (where scenario data comes
|
||||
// from, only driving -> cycling, no off-map starts or ends, etc)
|
||||
@ -141,7 +152,7 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
|
||||
"{} total driving trips in this area",
|
||||
prettyprint_usize(data.all_candidate_trips.len())
|
||||
))),
|
||||
1.0,
|
||||
0.0,
|
||||
),
|
||||
Widget::col(vec![
|
||||
"Who might cycle if it was safer?".text_widget(ctx),
|
||||
|
Loading…
Reference in New Issue
Block a user