mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
More ways to find signal demand dash. #331
This commit is contained in:
parent
3eb51d75a5
commit
990aa74d03
@ -208,6 +208,7 @@ pub fn current_demand(
|
||||
.bg(app.cs.inner_panel)
|
||||
.outline(2.0, Color::WHITE),
|
||||
);
|
||||
rows.push(Btn::text_fg("Explore demand across all traffic signals").build_def(ctx, None));
|
||||
|
||||
rows
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use crate::common::Warping;
|
||||
use crate::edit::{EditMode, RouteEditor};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::{color_for_agent_type, hotkey_btn, open_browser, ID};
|
||||
use crate::sandbox::{GameplayMode, SandboxMode, TimeWarpScreen};
|
||||
use crate::sandbox::{dashboards, GameplayMode, SandboxMode, TimeWarpScreen};
|
||||
use geom::{Circle, Distance, Time};
|
||||
use map_model::{AreaID, BuildingID, BusRouteID, BusStopID, IntersectionID, LaneID, ParkingLotID};
|
||||
use sim::{
|
||||
@ -564,6 +564,13 @@ impl InfoPanel {
|
||||
)),
|
||||
])),
|
||||
)
|
||||
} else if action == "Explore demand across all traffic signals" {
|
||||
(
|
||||
false,
|
||||
Some(Transition::Push(dashboards::TrafficSignalDemand::new(
|
||||
ctx, app,
|
||||
))),
|
||||
)
|
||||
} else {
|
||||
let mut close_panel = true;
|
||||
let t =
|
||||
|
@ -10,6 +10,7 @@ use crate::app::App;
|
||||
use crate::common::HeatmapOptions;
|
||||
use crate::game::{DrawBaselayer, State, Transition};
|
||||
use crate::helpers::hotkey_btn;
|
||||
use crate::sandbox::dashboards;
|
||||
use widgetry::{Btn, EventCtx, GfxCtx, Key, Line, Outcome, Panel, TextExt, Widget};
|
||||
|
||||
// TODO Good ideas in
|
||||
@ -115,21 +116,33 @@ impl PickLayer {
|
||||
.evenly_spaced(),
|
||||
);
|
||||
|
||||
col.extend(vec![
|
||||
"Experimental".draw_text(ctx),
|
||||
btn("amenities", Key::A),
|
||||
btn("backpressure", Key::Z),
|
||||
btn("elevation", Key::V),
|
||||
btn("parking efficiency", Key::O),
|
||||
if app.opts.dev {
|
||||
btn("blackholes", Key::L)
|
||||
} else {
|
||||
Widget::nothing()
|
||||
},
|
||||
]);
|
||||
if app.primary.sim.get_pandemic_model().is_some() {
|
||||
col.push(btn("pandemic model", Key::Y));
|
||||
}
|
||||
col.push(
|
||||
Widget::custom_row(vec![
|
||||
Widget::col(vec![
|
||||
"Experimental".draw_text(ctx),
|
||||
btn("amenities", Key::A),
|
||||
btn("backpressure", Key::Z),
|
||||
btn("elevation", Key::V),
|
||||
btn("parking efficiency", Key::O),
|
||||
if app.opts.dev {
|
||||
btn("blackholes", Key::L)
|
||||
} else {
|
||||
Widget::nothing()
|
||||
},
|
||||
if app.primary.sim.get_pandemic_model().is_some() {
|
||||
btn("pandemic model", Key::Y)
|
||||
} else {
|
||||
Widget::nothing()
|
||||
},
|
||||
]),
|
||||
Widget::col(vec![
|
||||
"Data".draw_text(ctx),
|
||||
btn("traffic signal demand", Key::M),
|
||||
btn("commuter patterns", Key::C),
|
||||
]),
|
||||
])
|
||||
.evenly_spaced(),
|
||||
);
|
||||
|
||||
Box::new(PickLayer {
|
||||
panel: Panel::new(Widget::col(col))
|
||||
@ -209,6 +222,12 @@ impl State for PickLayer {
|
||||
ctx, app, false, true, true,
|
||||
)));
|
||||
}
|
||||
"traffic signal demand" => {
|
||||
return Transition::Replace(dashboards::TrafficSignalDemand::new(ctx, app));
|
||||
}
|
||||
"commuter patterns" => {
|
||||
return Transition::Replace(dashboards::CommuterPatterns::new(ctx, app));
|
||||
}
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => {
|
||||
|
@ -7,6 +7,8 @@ mod trip_table;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::game::Transition;
|
||||
pub use commuter::CommuterPatterns;
|
||||
pub use traffic_signals::TrafficSignalDemand;
|
||||
pub use trip_table::TripTable;
|
||||
use widgetry::{Btn, Color, EventCtx, Key, Widget};
|
||||
|
||||
@ -67,10 +69,8 @@ impl DashTab {
|
||||
}
|
||||
"active traffic" => Transition::Replace(misc::ActiveTraffic::new(ctx, app)),
|
||||
"transit routes" => Transition::Replace(misc::TransitRoutes::new(ctx, app)),
|
||||
"commuter patterns" => Transition::Replace(commuter::CommuterPatterns::new(ctx, app)),
|
||||
"traffic signal demand" => {
|
||||
Transition::Replace(traffic_signals::TrafficSignalDemand::new(ctx, app))
|
||||
}
|
||||
"commuter patterns" => Transition::Replace(CommuterPatterns::new(ctx, app)),
|
||||
"traffic signal demand" => Transition::Replace(TrafficSignalDemand::new(ctx, app)),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
mod dashboards;
|
||||
pub mod dashboards;
|
||||
pub mod gameplay;
|
||||
mod misc_tools;
|
||||
mod speed;
|
||||
|
Loading…
Reference in New Issue
Block a user